[R] Preventing loading of user packages

Jonathon Love jon at thon.cc
Mon Aug 25 23:08:24 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

hey,

i was able to solve the problem by explicitly putting

R_LIBS_USER=''

in the /etc/Renviron file (it isn't enough simply to comment the entry
out, because it has a default value that magically comes from
somewhere else)

cheers


On 25/08/2014 9:59 pm, David Winsemius wrote:
> 
> On Aug 25, 2014, at 7:11 AM, Ista Zahn wrote:
> 
>> On Mon, Aug 25, 2014 at 5:58 AM, Jonathon Love <jon at 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?
> 


- -- 

JASP - A Fresh Way to Do Statistics
http://jasp-stats.org/

- --

How happy is he born and taught,
That serveth not another's will;
Whose armour is his honest thought,
And simple truth his utmost skill

This man is freed from servile bands
Of hope to rise, or fear to fall:
Lord of himself, though not of lands,
And, having nothing, yet hath all.

  -- Sir Henry Wotton





-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.20 (Darwin)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJT+6XIAAoJEH277gjmPGDYU8sP/1zd8KOdkCfP0RMvuuD/H8vm
nfyByHbTIPrSc/ERWYm8aoc1UAFO95U6tjxdPQzsVXli00RgRLpr9aa58HXsr8TI
i+2P5Hrq/b7nXG6rUIjN6YBoKW/cuYmujQhecvcD2VyLAGqAbSnRMq/9XSk2ghba
fIKsOgMj+VqVEiBjb2bpeq0UeGl0JmPzQ29s7A+ncKX7L9rDrPCV9Rf2wG205dIl
wZftqilwcwvKmIidnc//WMSZawNWUZZKmfxui+u1RqjkqgP9sNbtS8dsAHzZo/gY
N+BNBmZ7uQa7ewLkGUU0/gmAzPaAYUNfidMhEFhzXrpR1ncEAcdwgV/FKtJIOuij
ngttf2AsbB779S0cLz+I2uwxcUPh1WqJXAGWNHk+xDmyA/eUZIqxrPHtathDohJb
Z0IU7+ld2gI2qo/OGp4m47HktHOM1ky+bgGPQnE5CCgM4XxavIhgWvzXW9tq4nVo
YQEjGzhRW4WMTdpaF0DgjneNeYVUjtWy6uckdn4L3nP87qgPJSUwByWWZpzjEBjZ
WAvyIK8VAVgIQKeegN9Rr82Uw1JZXvnueTHE5sH/Mwur4T1wxl9CaHE2cDi2BnMJ
n1MCbPMp2rS+Zae7lJAhmXCM9P3wTtOfQVw5LyaXWIC4VF6MhZVVyFW7uWD0Z1pJ
h0GN6g/DUUImGhve9Oqs
=IjO5
-----END PGP SIGNATURE-----



More information about the R-help mailing list