How to switch R version in RStudio

I've installed the latest version of R (4.1.1) from source and it's located in /opt/R. The current version that is being used by RStudio is located in /usr/lib64/R (according to R.home() command). I want RStudio to use newly installed version but I don't know how to do this as solutions found on the Interner don't work. I followed those instructions Changing R versions for the RStudio Desktop IDE – RStudio Support but running export RSTUDIO_WHICH_R=/opt/R/4.1.1/bin/R doesn't change anything - which R still returns old path. Is there anyone thay may know why my RStudio can't detect the latest version of R?

System Information:

  • RStudio Edition: Server
  • RStudio Version: 1.1.463
  • OS Version: CentOS Linux 7
  • R Version: 3.5.2
R version 3.5.2 (2018-12-20)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.2  tools_3.5.2     rstudioapi_0.13 yaml_2.2.1   

the support article you are referring to is about the desktop IDE. for the server version please refer to 5 R Sessions | RStudio Workbench 1.4.1717-3. Akternatively, you can simply alter the PATH in such a way that the version in /opt/R is found first, e.g. by adding suitable links in /usr/local/bin, c.f. RStudio Install R - RStudio Documentation.

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.