[R] Summary --- Local library under Windoze.

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 1 19:24:27 CEST 2006


install.packages() in R 2.4.0 will make a full path out of a relative 
path, to avoid any confusion.  (normalizePath is a good way to do that, 
BTW).


On Fri, 1 Sep 2006, Rolf Turner wrote:

> Prof. Brian Ripley solved the problem.  He wrote:
> 
> > I was not aware that this works with relative paths for any version
> > of R.  Try using a full path, which always works for me.
> 
> 	I tried it using a full path, and bingo!  It worked
> 	like a charm.
> 
> 	Under Unix the relative path also works, but.
> 
> Prof. Ripley also remarked:
> 
> > If indeed your filesystem is readonly, you will have problems in
> > spades.  But is that box just dark and not ticked?  (That's a lovely
> > Windows gotcha that has caught people here many times.)
> 
> 	That box was indeed just dark and not ticked.  I was got!
> 
> James W. MacDonald suggested:
> 
> > I don't think this is how you should do things, since R won't know
> > about this library path. Instead, you should use .libPaths() to set
> > your library path and then install using that. Note that you will
> > likely need to put a call to .libPaths() into a .Rprofile file in
> > order to have this set on startup.
> > 
> >  > dir.create("C:/Documents and Settings/Jim/newlib")
> >  > .libPaths("C:/Documents and Settings/Jim/newlib")
> >  > install.packages("zoo")
> 
>    <snip>
> 
> > Then you can use install.packages("packagename", lib = .libPaths()[2]) 
> > if you want to use the 'stock' library directory, or just 
> > install.packages("packagename") to use your private one.
> 
> 	This is a red herring.  The install.packages() function
> 	does not care if the specified folder is in the library
> 	path.  I experimented to verify this.  The crucial thing,
> 	as Prof. Ripley suggested, is --- under Windoze --- to
> 	specify the full pathname of the library into which you wish
> 	to install the package.
> 
> 	[Perhaps this might be mentioned in the documentation for
> 	install.packages() --- to save future grief for dweebs
> 	like myself.]
> 
> 	It is indeed correct that R won't know about this library
> 	if it is not in the library path, but you can *tell* it
> 	about this library:
> 
> 		library("foo",lib.loc="lnilp")
> 
> 	(where ``lnilp'' means ``library not in library path'').
> 
> 	BTW, lib.loc can be specified by the *relative* path name,
> 	with no problem.
> 
> Thanks to all.
> 
> 				cheers,
> 
> 					Rolf Turner
> 					rolf at math.unb.ca
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list