Setting up RStudio Portable Default R version

人走茶凉 提交于 2019-12-02 20:42:57

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).

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

The link to R Portable above is a bit misleading. In order to run a portable version of R AND RStudio, you also need the 27MB portable RStudio here. What's even more confusing is that it has the same name as the RPortable file.

It took me a bit of time to figure that one out. Perhaps you could edit your question to point to both for those who wish for an IDE?

And, IMHO, it's not truly portable, because when you move from one machine to another you need to specify the R version on your USB drive and also the work directory. Pity.

I manage to link RStudio (not portable version) to the aforementioned version of R Portable, directly through Global Options -> R Version -> Choose a specific version of R -> Browse, and the trick was selecting the R-Portable\App\R-Portable folder. Choosing another one doesnt allow RStudio to find the instalation.

Im running RStudio 1.1.463.

Bye!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!