Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 908
k6adams Avatar asked Oct 08 '14 15:10

k6adams


People also ask

How do I change R version in RStudio?

You can select different versions of R by selecting it from the drop down list at the top of the browser window. The drop down menu will allow you to select the version of R you want to use. When you switch versions, the system will ask if you want to save your workspace before restarting your session.

Which version of R should I use?

For most users we would recommend using the 'native' build, that is the 32-bit version on 32-bit Windows and the 64-bit version of 64-bit Windows.

Is RStudio portable?

You can create a portable version of RStudio that will run on a USB drive. This allows you to run RStudio from any machine that has R already installed. Note: This allows RStudio to be portable, but your data and settings will remain on the local home directory of the computer.


2 Answers

I did not need to touch the registry.

I first installed R portable and then R Studio portable, both from Sourceforge. After launching R Studio for the first time, I was shown the option of choosing the installation of R to be used, as shown in

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

I browsed to branch \PortableApps\R-Portable\App\R-Portable\bin, where executables are located. There I selected the 64-bit version.

If you want to change later the version used, you open R Studio and go to Tools -> Option -> General -> R Version.

This avoids modifying the registry, with the two advantages of Portable Apps:

  1. Leaving no trace of the app in the system (or, at least, a much milder one).
  2. Being really portable (or, at least, much more so).
like image 74
sancho.s ReinstateMonicaCellio Avatar answered Oct 15 '22 01:10

sancho.s ReinstateMonicaCellio


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

like image 2
Jonathan Avatar answered Oct 15 '22 01:10

Jonathan