Change RStudio library path at home directory

10

2

Each time RStudio starts, it checks and creates ~/R if it doesn't exist. I want to change this path elsewhere. How can I do this configuration?

I know that

HOME=/some/path rstudio

will work. But can I configure through some config file?

Frozen Flame

Posted 2014-05-03T11:44:33.533

Reputation: 880

Answers

12

I got answer:

Edit file ~/.Renviron, add

R_LIBS_USER=/some/path

Next time RStudio starts, it will create directories in /some/path instead of ~/R.

Frozen Flame

Posted 2014-05-03T11:44:33.533

Reputation: 880

1

I found really useful this post:

https://community.rstudio.com/t/how-to-set-a-variable-in-renviron/5029/4

It shows hwo you can also use an helper function you can find in the package usethis to modify .Renviron:

usethis::edit_r_environ()

lucazav

Posted 2014-05-03T11:44:33.533

Reputation: 111