my.install.packages(pkg, lib, local.repo, url.repo, cmd = NULL, type = "source", dir.pkg)
pkg
.NULL
, then the
wget
shell command is used to obtain
url.repo
.install.packages
.cmd
, then specify a
character string with the name of this sub-folder.Nothing is returned because it is called for its side effect of downloading and installing a package.
User unfriendly way to download and install multiple
versions of R packages: (1) download to specified local
'repository' and (2) install to specified local library.
Only tested on mac OS 10.5.8. mip
is an alias for
my.install.packages
.
# create new library and repository cdir <- getwd() MyRlib <- paste(cdir, '/TMP_MyRlib/', sep = '') MyRrepo <- paste(cdir, '/TMP_MyRrepo/', sep = '') dir.create(MyRlib) dir.create(MyRrepo) # download (into MyRrepo) and install (into MyRlib) previous # version of the tensor package my.install.packages( pkg = 'tensor_1.4.tar.gz', lib = MyRlib, local.repo = MyRrepo, url.repo = 'http://cran.r-project.org/src/contrib/Archive/tensor/') # two versions living together library(tensor, lib.loc = MyRlib) packageVersion('tensor') # 1.4[1] ‘1.4’[1] ‘1.5’