General problem installing any R package


When trying to install any R package on your system, for example:



you get an error like the following:

The downloaded source packages are in
Updating HTML index of packages in '.Library'
Warning in install.packages :
cannot create file
'/opt/POC/lib64/Revo-7.3/R-3.1.1/lib64/R/doc/html/packages.html', reason
'Permission denied'


This error will occur when you do not have the necessary file permissions to be able to write to the current R library folder as the user 

you are currently logged in as.   You can use the R function '.libPaths()' to both query and change the current location R will use to install new user-contributed libraries.

For example:



To change the default location in which to add R user contributed libraries permanently, you can add this to your user-specific  .'Rprofile' file or to the system-wide ''  in '/usr/lib64/Revo-7.3/R-3.1.1/lib64/R/etc', if you need to change this setting for all of your R users.

Article ID: 3103821 - Last Review: 1 Nov 2015 - Revision: 1