pragya agarwal
2010-Oct-30 06:34 UTC
[R-sig-Debian] How to get write permissions for (lib="~/.R/library") ??
Hi I am trying to install R-igraph, but when I issue the command : install.packages("igraph", lib="~/.R/library") in the R session, I get the following error: Warning in install.packages("igraph", lib = "~/.R/library") : 'lib = "~/.R/library"' is not writable Error in install.packages("igraph", lib = "~/.R/library") : unable to install packages I have tried the command by logging in as the root user, but that also didn't work. Can anyone please help me?? Thanks, Pragya [[alternative HTML version deleted]]
Mathieu Basille
2010-Oct-30 14:25 UTC
[R-sig-Debian] How to get write permissions for (lib="~/.R/library") ??
Dear Pragya, Did you first create the folder '.R/library' in your home? It sounds weird that it is not writable... Next, if you log as root, it is likely that '~' refers to the home of the root user. Thus, you might need to explicitly give the complete name. But really, I wouldn't advise to install packages *in your home* while logged as root: every file will be owned by root... Once you manage to use '~/.R/library' as a regular user, my advice is to tell it in a .Renviron file (directly in '~/'), so that you don't need to explicitly tell while installing packages. ### Packages in the home directory: R_LIBS="~/.R/library:${R_LIBS}" With this, R will try first in '~/.R/library', and next in the usual folders if it didn't succeed. Hope this helps, Mathieu. Le 30/10/2010 02:34, pragya agarwal a ?crit :> Hi > > I am trying to install R-igraph, but when I issue the command : > > install.packages("igraph", lib="~/.R/library") > > in the R session, I get the following error: > > Warning in install.packages("igraph", lib = "~/.R/library") : > 'lib = "~/.R/library"' is not writable > Error in install.packages("igraph", lib = "~/.R/library") : > unable to install packages > > I have tried the command by logging in as the root user, but that also > didn't work. > > Can anyone please help me?? > > Thanks, > Pragya > > [[alternative HTML version deleted]] > > _______________________________________________ > R-SIG-Debian mailing list > R-SIG-Debian at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-debian-- ~$ whoami Mathieu Basille, Post-Doc ~$ locate Laboratoire d'?cologie Comportementale et de Conservation de la Faune + Centre d'?tude de la For?t D?partement de Biologie Universit? Laval, Qu?bec ~$ info http://ase-research.org/basille ~$ fortune ``If you can't win by reason, go for volume.'' Calvin, by Bill Watterson.
Paul Johnson
2010-Oct-30 20:49 UTC
[R-sig-Debian] How to get write permissions for (lib="~/.R/library") ??
On Sat, Oct 30, 2010 at 1:34 AM, pragya agarwal <pragya015 at gmail.com> wrote:> Hi > > I am trying to install R-igraph, but when I issue the command : > > install.packages("igraph", lib="~/.R/library") > > in the R session, I get the following error: > > Warning in install.packages("igraph", lib = "~/.R/library") : > ?'lib = "~/.R/library"' is not writable > Error in install.packages("igraph", lib = "~/.R/library") : > ?unable to install packagesI believe this means something went wrong, and in the past you may have run something as root or another user. Or that you have the library in .R, but the default in Ubuntu deb packaging is not a dot file, it is R/x86_64-pc-linux-gnu-library. That's a setting in /etc/R/Renviron. I have: R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/2.12'} R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'} Assuming that .R/library is what you really want to use, just give yourself permission there. Below, suppose "username" is you user login name, the one you want to own the files. You can re-set the permissions. This isn't an R thing, it is just a linux thing. Open a terminal # cd # ls -la .R That should let you see. # cd .R # chown -R username library "username" will now own library and everything below in it. PJ -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas