On Aug 25, 2014, at 7:11 AM, Ista Zahn wrote:

> On Mon, Aug 25, 2014 at 5:58 AM, Jonathon Love <j...@thon.cc> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA512
>> 
>> Hi,
>> 
>> I'm trying to prevent the loading of packages from the 'personal
>> library'
> 
> Of behalf of the users you are about to cripple, please, do not do that!

Hello jonathon and Ista;

(I think this might be the first time I've seriously with Ista.) I've been in 
the situation where I had multiple copies of packages in 2 different libraries 
and wanted to do exactly what was requested. I'm assuming that the "main" 
library directory is something other than '~/Library/R/3.0/library' and 
permissions allow packages to be accessed and placed there. A quick method 
would simply be to execute this at the command line (or if it needed to be 
repeated in .Rprofile) :

.libPaths( .libPaths()[!which(.libPaths() == '~/Library/R/3.0/library')] )

I suppose you could wrap some testing around this to prevent the removal of 
that path if it were the only one or if it were the path to the base and stats 
packages. Fo me this reports correctly that my base package is not there:

> grepl("~/Library/R/3.0/library" , attr(packageDescription('base'), "file") )
[1] FALSE

But this raises the question. Why is this happening and why don't you just 
delete the directory?

-- 
David.

> 
> -Ista
> 
> on an OS X machine. i.e. the packages that are normally
>> placed somewhere like:
>> 
>> ~/Library/R/3.0/library
>> 
>> There is a file in the R.framwork directory:
>> 
>> /Versions/3.0/Resources/etc/Renviron
>> 
>> which contains a line:
>> 
>> R_LIBS_USER=${R_LIBS_USER-'~/Library/R/3.0/library'}
>> 
>> but commenting this out does not prevent R from loading from that
>> location.
>> 
>> is there a way to prevent loading from that location?
>> 
>> with thanks
>> 
>> jonathon
>> 
>> - --
>> 


David Winsemius
Alameda, CA, USA

______________________________________________
R-help@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.

Reply via email to