R: require(foo, lib.loc=bar) does not forward lib.loc=bar to dependencies -


i have separate library folder. installed ks follows:

> install.packages('ks', lib='packages')    there binary version available (and   installed) source version later:    binary source ks  1.9.2  1.9.4  installing dependencies 'kernsmooth', 'misc3d', 'mvtnorm', 'rgl', 'multi cool' 

now, want load these packages.

> require(ks, lib.loc='packages') loading required package: ks failed error:  'package 'kernsmooth' required 'ks' not found' 

that is, require finds ks not kernsmooth - because not trying load kernsmooth packages. can load manually:

> require(kernsmooth, lib.loc='packages') loading required package: kernsmooth kernsmooth 2.23 loaded copyright m. p. wand 1997-2009 warning message: package 'kernsmooth' built under r version 3.1.2  

i can try require(ks, lib.loc='packages) again, tell me next package, misc3d not loaded yet.

do have manually load dependencies library folder? expected work automatically, i.e. if require(foo, bar), foo try load dependencies bar.

the function .libpaths used , set paths r looks packages. if following should work fine.

install.packages('ks', lib='packages')  .libpaths("packages") require(ks) 

in fact, if plan on using "packages" lot can set before installing, makes new packages go there default.

.libpaths("packages") .libpaths() 
[1] "/home/christofer/packages"     "/usr/local/lib/r/site-library" [3] "/usr/lib/r/site-library"       "/usr/lib/r/library" 
install.packages('ks') 
installing package ‘/home/christofer/packages’ (as ‘lib’ unspecified) ... 
require(ks) 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -