I have a lot of packages installed in ~/R/x86_64-pc-linux-gnu-library/3.4/
. Today, I opened R, and attempted to run some code, and I found that packages were not being recognised:
Error in library("some_package"): there is no package called ‘some_package’
I looked at the paths, and I got this:
.libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library"
which explains why packages are not longer recognised. Now, I know how to solve this (add local path to R paths, e.g. modifying /etc/R/Renviron
).
Notice that I updated R via sudo apt-get update...
. However, the update was minor (from 3.4 to 3.4.1) (so this is not a duplicate of this question). Here is the command line output of the update/upgrade. It seems the issue might have been related to the update of /etc/R/Renviron
, as the line Replacing config file /etc/R/Renviron with new version
indicates.
My packages source is
deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
My question is, why did this change happen? Does every minor change in R restores the paths to default? Is it somewhere explained in some documentation? I can't find a warning about it here or elsewhere.