[R] Unable to create directory?

Luke Whitaker luke at inpharmatica.co.uk
Fri Apr 25 16:28:19 CEST 2003

On Thu, 24 Apr 2003, Robert Lundqvist wrote:

> I have tried to install the pls.pcr package, but as a install newbie, I
> wasn't too successful. I tried the command
> "install.package("pls.pcr",lib="~/lib/R/",CRAN="http://mirrors.sunsite.dk/cran").
> The download seemed to run smoothly, but in the end I got the response
> "ERROR: cannot write to or create directory '~/lib/R'"
> Before I try to get my sysadmins to work on this, is it a non-R
> problem (i e something wrong with directory premissions) or is it
> some R detail I've missed? Hints anyone?
> (I run R in a Unix environment: a SunRay/Solaris combination.)
> --robert
> ------------------------------

Just guessing, but I think the problem is with using '~' to mean
your home directory. The shell normally interprets the '~', but
I don't think the shell is doing anything here. I suspect R is
trying to create a directory with the literal name '~/lib/R'.

Replace '~' with the full path of your home directory, and make sure that
the 'lib' part already exists before you do the install.package.
(ie do "mkdir ~/lib" first if it doesn't exist).


More information about the R-help mailing list