[R] Local library under Windoze.

James W. MacDonald jmacdon at med.umich.edu
Fri Sep 1 16:10:49 CEST 2006


Hi Rolf,

Rolf Turner wrote:
> Continuing to try to customize my environment for using R under
> Windoze, I experimented with installing a package from CRAN in a
> local library ``Lib''.
> 
> I created the directory ``Lib'' in the folder in which R starts,
> and then executed
> 
> 	> install.packages("abind",lib="Lib")

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")
Warning in install.packages("zoo") : argument 'lib' is missing: using 
C:/Documents and Settings/Jim/newlib
trying URL 
'http://www.biometrics.mtu.edu/CRAN/bin/windows/contrib/2.3/zoo_1.2-0.zip'
Content type 'application/zip' length 724426 bytes
opened URL
downloaded 707Kb

package 'zoo' successfully unpacked and MD5 sums checked

The downloaded packages are in
         C:\WINDOWS\Temp\RtmpVcjtqb\downloaded_packages
updating HTML package descriptions
 > dir("C:/Documents and Settings/Jim/newlib")
[1] "zoo"

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.

HTH,

Jim


> 
> Everything went according to form (I got prompted to choose a mirror,
> etc.) until the end of the show when I got the warning message
> 
> Warning: unable to move temporary installation 'C:\Documents and
> Settings\rolf\My Documents\Rstuff\Lib\file5f906952\Lib\file5f906952\abind to
> 'C:\Documents and Settings\rolf\My Documents\Rstuff\Lib\file5f906952\Lib\abind'
> 
> [I have folded the foregoing warning --- which came out as a single line ---
> to make it fit in an 80 character wide screen.]
> 
> [I was also told that the ``downloaded packages are in ...'', and when
> I looked in the indicated folder the zip file was indeed there ---
> but a fat lot of good that does me.]
> 
> The warning was more like an *error*. When this had finished, the folder
> Lib was empty; no sign of the file5f906952 stuff, or anything else.
> 
> Can anyone explain to me what's going on/wrong?  There is no problem
> apparently if I do
> 
> 	> install.packages("abind")
> 
> which installs into the ``system'' library.  In current circumstances
> this is good enough --- since I have write permission on the ``system''
> library, I can just use that.  So this is, for the moment, an
> academic question.  Still the facility seems to be *there* for
> installing to a local user-owned library, and it seems not to be
> working for me, and I'd like to figure out why.
> 
> I thought for a moment that I'd found the problem a little while
> back, when I noticed that ``Lib'' was ``Readonly''.  But then
> when I tried to change that --- ``unclicking'' the Readonly box
> in the ``Properties'' of Lib --- I found that I couldn't.  When
> I looked at the Properties again, I found it was back to being
> Readonly again.  (With no warning or error message of any kind.)
> Some further investigation seemed to indicate that *all* folders
> are Readonly.  (Is this really as it should be?  And if so, what's
> the point of having this property for folders?)
> 
> Can anyone enlighten me?
> 
> 				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.


-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623


**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the R-help mailing list