Re: [R] install.packages for local zip files

From: Muhammad Subianto <msubianto_at_gmail.com>
Date: Mon 17 Jul 2006 - 20:53:22 EST

On 7/16/06, Daniel Gatti <dmgatti@mindspring.com> wrote:
> O/S: Linux
> R version : 2.2.1
>
> The R server doesn't have http internet access. And the sys admins will
> not install the R libraries that I requested. So I have downloaded the
> packages that I want to intall and have moved them into my home
> directory on the server. These are a series of *.tar.gz files. I want
> to install the R libraries in my home directory, but I can't get it to
> work. According to the install.packages documentation :
>
> install.packages(pkgs, lib, repos = getOption("repos"), contriburl =
> contrib.url(repos, type), method, available = NULL, destdir = NULL,
> installWithVers = FALSE, dependencies = FALSE, type = getOption("pkgType"))
>
> repos: character vector, the base URL(s) of the repositories to use,
> i.e., .... Can be 'NULL' to install from local '.tar.gz' files.
>
> contriburl: URL(s) of the contrib section of the repositories. ......
> Can be 'NULL' to install from local '.tar.gz' files.
>
>
> pkgs: character vector of the short names of packages/bundles whose
> current versions should be downloaded from the repositories.
> If 'repos = NULL', a character vector of file paths of
> '.tar.gz' files. These can be source archives or binary
> package/bundle archive files (as created by 'R CMD build
> --binary'). ......
>
> lib: character vector giving the library directories where to install
> the packages. Recycled as needed.
>
> So I have issued a command like this:
>
> > install.packages(pkgs="~/Rdownloads/hgug4112a_1.12.0.tar.gz", lib =
> "~/Rlib", repos=NULL, contriburl=NULL)
>
> Warning in download.packages(pkgs, destdir = tmpd, available =
> available, :
> no package '~/Rdownloads/hgug4112a_1.12.0.tar.gz' at the
> repositories
>
> As far as I can tell, I've given it the full path to the zip file, the
> directory in which to install the library and I've set the repository
> path to 'NULL' to indicate that I'm installing from an already
> downloaded zip file. But I'm missing something. Any ideas?
>
> Thanks,
> Dan
>
> ______________________________________________
> R-help@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
>

Put your packages, for example, in directory "/dir/of/pkgs" library(tools)
write_PACKAGES("/dir/of/pkgs")

and the package will be installed to "/dir/of/R/libs"

install.packages("NameOfPkgs",

                 lib="/dir/of/R/libs",
                 repos=NULL,
                 dependencies=TRUE,
                 contriburl="file:////dir/of/pkgs")

Best, Muhammad Subianto



R-help@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 Received on Mon Jul 17 20:56:54 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 17 Jul 2006 - 22:16:15 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.