[R-SIG-Mac] install.packages: location of system-wide library tree

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed May 25 15:18:03 CEST 2011


.Library.site becomes not empty when you create a site library, for example by
  mkdir  {PATH to R}/R/lib64/site-library
(of course lib64 assumes a 64 bit architecture)

Kasper

On Wed, May 25, 2011 at 6:51 AM, Sean Davis <sdavis2 at mail.nih.gov> wrote:
> See help(.Library).
>
> Sean
>
> On Wed, May 25, 2011 at 6:35 AM, jochen laubrock
> <jochen.laubrock at gmail.com> wrote:
>> Dear expeRts,
>>
>> On (my?) macs, .libPaths() contains two entries, with the first pointing to a user's library tree and the second to the system-wide library tree, as in
>>
>> ## begin code
>> v <- getRversion()
>> userLib <- Sys.glob(sprintf("~/Library/R/%s.%s/library", v$major, v$minor))
>> systemLib <- sprintf("/Library/Frameworks/R.framework/Versions/%s.%s/Resources/library", v$major, v$minor)
>> userLib == .libPaths()[1]
>> systemLib == .libPaths()[2]
>> # both return TRUE (on my system)
>> ## end code
>>
>> When installing new packages, I would like to make them available to all users. However, the 'lib' parameter of 'install.packages' defaults to the first element of '.libPaths()'. How do I reliably specify the location of the system library: Is it always equal to '.libPaths()[-1]'? And why is '.Library.site' empty?
>>
>> Jochen
>>
>>
>>> sessionInfo()
>> R version 2.13.0 (2011-04-13)
>> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>>
>> ----
>> Jochen Laubrock, Dept. of Psychology, University of Potsdam,
>> Karl-Liebknecht-Strasse 24-25, 14476 Potsdam, Germany
>> phone: +49-331-977-2346, fax: +49-331-977-2793
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>



More information about the R-SIG-Mac mailing list