[R] Package installation

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Jul 9 13:58:26 CEST 2018


On 09/07/2018 6:18 AM, Steven Yen wrote:
> I have had trouble installing packages (e.g., car, aod) in some
> computers (such as computers in the student lab) but no problem in my
> own laptop.
> Installation typically goes through, but after I got out and back in R
> (and RStudios), the error message says "packages xxx not available".
> That is, earlier installation of the packages did not stay (despite the
> successful installation message).
> I went back as far as R3.0.3 and there is no problem.
> Does this tell anyone what may be going on? Thanks.
> 

The most common package installation problem in Windows is using 
different permissions to install R and the packages.  Typically R is 
installed as administrator, but the packages are not.  This means the 
packages can't be installed to the system library, so they get installed 
in a user's personal library, and the user probably may need to set 
.libPaths() explicitly to see them.

To check for this, print .libPaths() just after installing the packages, 
and again when starting a new session.  If the printed list of paths is 
different, you'll have problems.

Duncan Murdoch




More information about the R-help mailing list