I have roughly 80 or so packages sources. These were obtained by taking a snapshot of certain CRAN packages a few months ago using install.packages( pkgs = pckNames, destdir = "/home/max", repos = "http://cran.r-project.org" dependencies = c("Depends", "Imports", "Suggests")) We need to install these versions of the packages across a few different architectures/systems (linux, solaris, 32- and 64-bit). Right now, we are constrained to version 2.5.1 (I know, I know). Right now, I'd use tarList <- list.files() tarList <- grep(".tar.gz", tarList, fixed = TRUE, value = TRUE) install.packages (tarList, repos = NULL) to install, but the package dependencies are ignored. For example, XML gets installed after other packages that depend on it. I've looked through ?install.packages and I have tried using install.packages ( tarList, repos = NULL, dependencies = c("Depends", "Imports", "Suggests")) but this did not appear to change the install ordering. Is there a simpler way to do this rather than trial and error? Thanks, Max> sessionInfo()R version 2.5.1 (2007-06-27) i686-pc-linux-gnu locale: C attached base packages: [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7] "base"
Hi Max, On 14 November 2007 at 09:34, Kuhn, Max wrote: | I have roughly 80 or so packages sources. These were obtained by taking | a snapshot of certain CRAN packages a few months ago using | | install.packages( | pkgs = pckNames, | destdir = "/home/max", | repos = "http://cran.r-project.org" | dependencies = c("Depends", "Imports", "Suggests")) | | We need to install these versions of the packages across a few different | architectures/systems (linux, solaris, 32- and 64-bit). Right now, we | are constrained to version 2.5.1 (I know, I know). | | Right now, I'd use | | tarList <- list.files() | tarList <- grep(".tar.gz", tarList, fixed = TRUE, value = TRUE) | install.packages (tarList, repos = NULL) | | to install, but the package dependencies are ignored. For example, XML | gets installed after other packages that depend on it. | | I've looked through ?install.packages and I have tried using | | install.packages ( | tarList, repos = NULL, | dependencies = c("Depends", "Imports", "Suggests")) | | but this did not appear to change the install ordering. | | Is there a simpler way to do this rather than trial and error? When trying to package the by-now-gargantuan Rmetrics for Debian (which is still ongoing), I looked around for some Depends builders. Turns out that BioC has this. E.g. the following worked for: ## > install.packages("Biobase", repo="http://www.bioconductor.org") ## > repos <- Biobase:::biocReposList() ## > install.packages("pkgDepTools", repos=repos["bioc"]) ## > library(pkgDepTools) ## Loading required package: graph ## Loading required package: RBGL ## > CRANdeps <- makeDepGraph(repos["cran"], type="source") ## > getInstallOrder("Rmetrics", CRANdeps, needed.only=FALSE) worked for me. I meant to add some code for Graphviz visualization (or look for it, Seth et al probably already wrote it) but what you get from getInstallOrder() should suit your needs here. Hth, Dirk -- Three out of two people have difficulties with fractions.
On Wed, 14 Nov 2007, Kuhn, Max wrote:> I have roughly 80 or so packages sources. These were obtained by taking > a snapshot of certain CRAN packages a few months ago using > > install.packages( > pkgs = pckNames, > destdir = "/home/max", > repos = "http://cran.r-project.org" > dependencies = c("Depends", "Imports", "Suggests")) > > We need to install these versions of the packages across a few different > architectures/systems (linux, solaris, 32- and 64-bit). Right now, we > are constrained to version 2.5.1 (I know, I know). > > Right now, I'd use > > tarList <- list.files() > tarList <- grep(".tar.gz", tarList, fixed = TRUE, value = TRUE) > install.packages (tarList, repos = NULL)You need the information from available.packages() to do the ordering, so you need a non-NULL repository. This works if you convert your local collection into a local repository. You will need a PACKAGES file, but tools::write_PACKAGES can re-create one for you. There are also dependency tools in package tools and on BioC.> to install, but the package dependencies are ignored. For example, XML > gets installed after other packages that depend on it. > > I've looked through ?install.packages and I have tried using > > install.packages ( > tarList, repos = NULL, > dependencies = c("Depends", "Imports", "Suggests")) > > but this did not appear to change the install ordering. > > Is there a simpler way to do this rather than trial and error? > > Thanks, > > Max-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595