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

Rolf Turner rolf at erdos.math.unb.ca
Fri Sep 1 19:11:11 CEST 2006


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



More information about the R-help mailing list