From ehlers at ucalgary.ca  Wed Nov 25 08:41:32 2009
From: ehlers at ucalgary.ca (Peter Ehlers)
Date: Wed, 25 Nov 2009 00:41:32 -0700
Subject: [Rd] The "lib" argument in install.packages().
In-Reply-To: <9D5D085D-E820-44A7-9FA8-66DCC7E9799B@auckland.ac.nz>
References: <9D5D085D-E820-44A7-9FA8-66DCC7E9799B@auckland.ac.nz>
Message-ID: <4B0CDFAC.1010400@ucalgary.ca>

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
> 
>



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