1

I had my packages in the folder ~/R/x86_64-pc-linux-gnu-library/3.4/, which I moved and renamed without thinking. Now, I've restored the directory but R won't load packages unless I supply the argument lib.loc="~/R/x86_64-pc-linux-gnu-library/3.4/. How can I remind R to always look for packages there?

  • 2
    You should probably create (or edit) an `.Renviron` file in your home directory: see [here](https://csgillespie.github.io/efficientR/3-3-r-startup.html#renviron) for some help. – Marius Jan 30 '18 at 01:50

1 Answers1

0

I found the answer right after I posted, in this thread but I guess I'll leave it here for future reference. All you have to do is add the directory to the .libPaths variable with

.libPaths("~/R/x86_64-pc-linux-gnu-library/3.4/")