randy3k/radian

Can't switch R binary to a rig installed R version

Opened this issue · 0 comments

I often face the issue that I have to switch between different R versions. Gladly, rig makes this easy but I also use radian for years. So I thought that I could easily combine the best of both worlds by linking radian to the currently in use version of R installed through rig. But when I do that by using radian --r-binary=/opt/R/current/lib/R to link radian to the currently default R version 4.1.3, I get the following error:

Traceback (most recent call last):
File "/home/user303/.local/bin/radian", line 8, in
sys.exit(main())
^^^^^^
File "/home/user303/.local/pipx/venvs/radian/lib/python3.11/site-packages/radian/app.py", line 52, in main
r_home = Rhome()
^^^^^^^
File "/home/user303/.local/pipx/venvs/radian/lib/python3.11/site-packages/rchitect/utils.py", line 66, in Rhome
raise RuntimeError("R binary ({}) does not exist.".format(os.environ['R_BINARY']))
RuntimeError: R binary (/opt/R/current/lib/R) does not exist.

Which is strange because it does exist. If I start RStudio instead of VSC + radian it works like intendet.
However it gets more strange if I check the radian version radian --version:

radian version: 0.6.9
r executable: /opt/R/4.1.3/lib/R/bin/R
r version: 4.1.3
python executable: /home/user303/.local/pipx/venvs/radian/bin/python
python version: 3.11.2

With this I thought radian would use the desired version despite the error message above. So I started VSC, opened a new R terminal and typed R.version and got:

platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status Patched
major 4
minor 2.2
year 2022
month 11
day 10
svn rev 83330
language R
version.string R version 4.2.2 Patched (2022-11-10 r83330)
nickname Innocent and Trusting

You can imagine that I'm very confused and I appreciate any help.

System

  • Debian 12 Bookworm
  • radian 0.6.9
  • python 3.11.2
  • rig 0.7.0