set a different R version

Hi,
I have two versions of R installed in my server. one is located at /usr/bin/R and this is the R that Rstudio uses. I have another R installed in my local dir /home/gorliver/software/R/bin/R.
I would like set the local R for Rstudio. I have tried:

  1. export RSTUDIO_WHICH_R=/home/gorliver/software/R/bin/R and restart rstudio server.
  2. add rsession-which-r=/home/gorliver/software/R/bin/R in /etc/rstudio/rserver.conf and restart rstudio server.
  3. add below two lines to /etc/rstudio/r-version and restart rstudio server.
    [*]
    r-version = /home/gorliver/software/R/bin/

Unfortunate, none of them works. I wonder what I have missed? Any suggestions are highly appreciated.

You can modify your PATH in your init file, on debian for example it's located here sudo nano /etc/init.d/rstudio-server, set your PATH pointing to the desired R version PATH=/home/gorliver/software/R/bin/:/sbin:/usr/sbin:/bin:/usr/bin

Thank you for your suggestions.
I use centos 7, there is no /etc/init.d/rstudio-server so I created one and add PATH=/home/gorliver/software/R/bin/:/sbin:/usr/sbin:/bin:/usr/bin in the file.

It doesn't work and show the old version (/usr/bin/R):

Did I miss anything?

That was an example on debian I don't know where the file is located on centos 7, maybe someone else with a centos setup could help you more.

It turned out that my local R was not compiled with shared lib. Reinstall R with --enable-R-shlib and it works perfectly.
Many thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.