k6adams k6adams - 3 months ago 51
R Question

Setting up RStudio Portable Default R version

I recently discovered a portable version of R and RStudio @

http://rportable.sourceforge.net/

Open source rocks!

At any-rate, I am jumping from pc to pc at my university, and I'd like to get Portable R-studio to recognize Portable R as the default R version. Most computers at the university already have several versions of r-installed, and RStudio uses one of those versions of R. When I go into the Global Options to change the default version, it does not "see" portable R on the USB drive.

I am basically hopping I can run R without constantly having to download packages, specifying the work directory, downloading Scripts, data from Google Drive, etc...

Any suggestions? I am open. Thanks for your help.

Answer

On Windows, RStudio uses the system registry to find where installed versions of R are located. You'll need to edit the registry yourself to let it know about new versions. Fortunately you can do this in HKEY_CURRENT_USER so admin rights shouldn't be required. Here are the keys and values you'll want to write:

http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Does-R-use-the-Registry_003f

More detail about how RStudio selects the R version to run here:

https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R