I installed some downloaded packages in R. I always do $sudo R CMD INSTALL <anRpackage.tar.gz> By default it is storing these packages into my directory /home/mary/R/x86_64-pc-linux-gnu-library/2.13/. However I want them to be systemwide into /usr/local/lib/R/site-library/ folder. I tried $sudo R R> install.packages("anRpackage", dep=TRUE) I did not succeed into getting them install in req folder. Any idea? -- ------------- Mary Kindall Yorktown Heights, NY USA [[alternative HTML version deleted]]
Take a look at: R CMD INSTALL --help and you will realize that you need to specify the library path, e.g. R CMD INSTALL anRpackage --library=/usr/local/... or take a look at ?install.packages and use the second argument, e.g. install.packages('anRpackage', lib = '/usr/local/...') Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Fri, Aug 19, 2011 at 12:10 PM, Mary Kindall <mary.kindall at gmail.com> wrote:> I installed some downloaded packages in R. I always do > $sudo R CMD INSTALL <anRpackage.tar.gz> > > > By default it is storing these packages into my directory > /home/mary/R/x86_64-pc-linux-gnu-library/2.13/. > > However I want them to be systemwide into /usr/local/lib/R/site-library/ > folder. > > I tried > $sudo R > R> install.packages("anRpackage", dep=TRUE) > > I did not succeed into getting them install in req folder. > Any idea? > > > > -- > ------------- > Mary Kindall > Yorktown Heights, NY > USA > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org 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. >
At 18:10 19/08/2011, Mary Kindall wrote:>I installed some downloaded packages in R. I always do >$sudo R CMD INSTALL <anRpackage.tar.gz> > > >By default it is storing these packages into my directory >/home/mary/R/x86_64-pc-linux-gnu-library/2.13/. > >However I want them to be systemwide into /usr/local/lib/R/site-library/ >folder. > >I tried >$sudo R >R> install.packages("anRpackage", dep=TRUE) > >I did not succeed into getting them install in req folder.There is a parameter lib to install.packages. Does that do what you would like?>Any idea? > > > >-- >------------- >Mary Kindall >Yorktown Heights, NY >USA > > [[alternative HTML version deleted]] > >_______________________________________________ >R-SIG-Debian mailing list >R-SIG-Debian at r-project.org >https://stat.ethz.ch/mailman/listinfo/r-sig-debianMichael Dewey info at aghmed.fsnet.co.uk http://www.aghmed.fsnet.co.uk/home.html
(Removed r-help, keeping it on r-sig-debian only) On 19 August 2011 at 13:10, Mary Kindall wrote: | I installed some downloaded packages in R. I always do | $sudo R CMD INSTALL <anRpackage.tar.gz> | | | By default it is storing these packages into my directory | /home/mary/R/x86_64-pc-linux-gnu-library/2.13/. | | However I want them to be systemwide into /usr/local/lib/R/site-library/ | folder. | | I tried | $sudo R | R> install.packages("anRpackage", dep=TRUE) | | I did not succeed into getting them install in req folder. | Any idea? Yes, this is my preference too, and it can be achieved in a number of ways. Here is what I do: 1. Write-permission -- I have set up the Debian / Ubuntu package to create the top-level directory witrh group 'staff' and group-wide mode: $ ls -dl /usr/local/lib/R/site-library/ drwxrwsr-x 2 root staff 4096 2011-03-11 09:51 /usr/local/lib/R/site-library/ So you have to add yourself to the 'staff' group (which always exists), or another suitable group, and/or take other equivalent measures. If you can write there, you do not even need 'sudo'. That is a good thing. 2. Select the target directory explicitly, so a local R function helps, or in my case a local adaption of the script 'install.r' from the littler package: $ cat ~/bin/install.r #!/usr/bin/env r # # a simple example to install one or more packages if (is.null(argv) | length(argv)<1) { cat("Usage: installr.r pkg1 [pkg2 pkg3 ...]\n") q() } ## adjust as necessary, see help('download.packages') #repos <- "http://cran.us.r-project.org" repos <- "http://cran.r-project.org" ## this makes sense on Debian where no packages touch /usr/local lib.loc <- "/usr/local/lib/R/site-library" install.packages(argv, lib.loc, repos) The main key here is that the source repo and the target directory are hardwired, and then I can just say $ ~/bin/install.r foo bar biz and those three packages get installed to /usr/local/lib/R/site-library Hope this helps, Dirk -- Two new Rcpp master classes for R and C++ integration scheduled for New York (Sep 24) and San Francisco (Oct 8), more details are at http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10 http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php