Skip to content
Prev 343402 / 398506 Next

Preventing loading of user packages

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

            
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:
[1] FALSE

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