Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

General problem installing any R package


View products that this article applies to.

Problem

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

install.packages("proto")

 

you get an error like the following:

The downloaded source packages are in
?/tmp/Rtmph4YKLX/downloaded_packages?
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'

↑ Back to the top


Solution

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:

>.libPaths("/home/testuser/Rlib")

 

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 '.Rprofile.site'  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.

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 3103821
Revision : 1
Created on : 1/7/2017
Published on : 11/1/2015
Exists online : False
Views : 80