[R] how to remove paths from where library() looks for packages
Lynd Bacon
lbacon at lba.com
Thu Dec 27 14:41:57 CET 2007
Thanks, Henrique! I'm not sure this will help since the paths are
already unique.
Phil Spector wrote separately(Phil, I hope it's ok that I quote you here
for the list):
> Lynd -
> If the message bothers you, look at /etc/R/Renviron and modify
> the line that defines R_LIBS . However, note that these are set
> up for you so that if you install packages through either Ubuntu's
> repositories or the install.package() function, everything should
> just work, so you might want to leave things as they are.
This line in this particular installation of R 2.6.1 on my Ubuntu 7.10
workstation reads:
R_LIBS=${R_LIBS-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}
One question (for me, at least), is why did I start to get this warning
message, to begin with? I wasn't getting it with an earlier version of R.
The warning I'm getting started to appear after I updated from 2.5.1 to
2.6.1. I did this using the procedure described on:
http://cran.cnr.berkeley.edu/bin/linux/ubuntu/
I used Ubuntu's Synaptic Package Manager to install R initially on this
particular machine, from what I can recall. After updating to 2.6.1,
the packages I had previously installed with 2.5.1 were in the directory
/usr/local/lib/R/site-library. When I now install additional packages
in 2.6.1, they are installed to this directory, and not to
/usr/lib/R/site-library, the directory library() gives warnings about.
My hypothesis is that the default library configurations for the two
versions were different for some reason.
Thanks, Henrique and Phil, for your help!
Cheers,
Lynd
Henrique Dallazuanna wrote:
> Perhaps this:
>
> .libPaths(unique(installed.packages()[,2]))
>
> On 25/12/2007, Lynd Bacon <lbacon at lba.com> wrote:
>
>> Greetings. My current installation of R 2.6.1 on Unbuntu 7.10 ("Gutsy")
>> is looking for packages in a directory that doesn't contain any:
>>
>> > library()
>> Warning message:
>> In library() : library "/usr/lib/R/site-library" contains no packages
>>
>> > .libPaths()
>> [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
>> [3] "/usr/lib/R/library"
>>
>> I'd like to eliminate the path to the empty directory so I don't get
>> this vexsome warning message. Any and all suggestions will be greatly
>> appreciated!
>>
>> Cheers,
>>
>> Lynd
>>
>> --
>> _________________________________________
>> Lynd Bacon
>> Woodside CA USA GMT-08:00
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
>
>
--
_________________________________________
Lynd Bacon
Woodside CA USA GMT-08:00
+1 650.593.2198 (home office)
+1 650.462.8015 (YouGov/Polimetrix Inc.)
+1 650.863.1959 (mobile)
lbacon at LBA.com
More information about the R-help
mailing list