updating R and keeping R packages installed
http://zvfak.blogspot.de/2012/06/updating-r-but-keeping-your-installed.html
This is probably an issue that has been addressed by many blog posts (including these ones: [link1] and [link2]), and can be deduced from R Installation and Administration manual. However, I will post it here for future reference. The problem is that when you update R you usually need to re-install your libraries or change .libPaths() to point to a location that has your previous libraries.The solution below will work for unix-like operating systems including Mac OS X. First, we need a location to install all our packages from now on. This can be any directory, and location of this directory should be indicated in ~/.Renviron file. Let's create that directory now:
mkdir ~/Rlibs
We created Rlibs directory in our home directory. Now, create the .Renviron file in your home directory and enter the following line and save the .Renviron file: R_LIBS=~/Rlibs We can now start R and install any library. The libraries will be installed to ~/Rlibs, and when we update R, R will still look for libraries in ~/Rlibs directory so we don't need to re-install the libraries. However, we will need to update the libraries in ~/Rlibs directory to their most recent versions. All we need to do is to runupdate.packages() in R console, and the libraries will be updated.
没有评论:
发表评论