Change Rstudio Library Path at Home Directory

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?

2 Answers

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.

I found really useful this post:

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

usethis::edit_r_environ()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest