[Rd] The "lib" argument in install.packages().

Peter Ehlers ehlers at ucalgary.ca
Wed Nov 25 08:41:32 CET 2009


Rolf,

If you want to avoid the warning, why not use lib=.libPaths()[1]?
This is not to say that your suggestions aren't useful.

Cheers,
Peter Ehlers

Rolf Turner wrote:
> 
> I was flummoxed for a long time by errors generated when I did
> something like
> 
>     install.packages(foo,lib="Rlib")
> 
> where ``Rlib'' is my personalized directory of R packages, which
> lives in my home directory (from which I started R before issuing
> the foregoing install.packages() call.
> 
> Recently someone (I forget who, but thanks very much to whomever
> it was) pointed out that I needed to specify the complete pathname,
> i.e. "/Users/rturner/Rlib" rather than the relative pathname "Rlib"
> or "./Rlib" (which I'd also tried).  When the complete pathname is
> given the install.packages() call works seamlessly.
> 
> Remark:  I have "/Users/rturner/Rlib" as the first entry of my .libPaths(),
> so just doing install.packages(foo) works --- but this gives a warning
> about lib not being specified, which I find irksome.
> 
> Questions:
> 
>     (1) Why is it that the complete pathname of ``lib'' has to
>     be specified?  Cannot the code of install.packages() be
>     adjusted to work with relative pathnames?
> 
>     (2) If indeed this is not possible, wouldn't it be kind and
>     helpful, to us young ( :-) ) and naive persons, to put an
>     indication in the help file for install.packages that the
>     complete pathname is required?
> 
>     cheers,
> 
>         Rolf Turner
> 
> P. S. > sessionInfo()
> R version 2.10.0 (2009-10-26)
> i386-apple-darwin8.11.1
> 
> locale:
> [1] C
> 
> attached base packages:
> [1] datasets  utils     stats     graphics  grDevices methods   base
> 
> other attached packages:
> [1] misc_0.0-11    fortunes_1.3-6 MASS_7.3-3
> 
> 
> ######################################################################
> Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>



More information about the R-devel mailing list