Performs recursive retrieve for Depends, Imports and LinkLibrary. Performs non-recursive retrieve for Suggests.

pkgDep(pkg, availPkgs, repos = getOption("repos"), type = "source",
  depends = TRUE, suggests = TRUE, enhances = FALSE,
  includeBasePkgs = FALSE, Rversion = R.version, quiet = FALSE, ...)

Arguments

pkg

Character vector of packages.

availPkgs

Data frame with an element called package. The package element is a vector of available packages. Defaults to reading this list from CRAN, using available.packages()

repos

URL(s) of the 'contrib' sections of the repositories, e.g. "http://cran.us.r-project.org". Passed to available.packages()

type

Possible values are (currently) "source", "mac.binary" and "win.binary": the binary types can be listed and downloaded but not installed on other platforms. Passed to download.packages().

depends

If TRUE, retrieves Depends, Imports and LinkingTo dependencies (non-recursively)

suggests

If TRUE, retrieves Suggests dependencies (non-recursively)

enhances

If TRUE, retrieves Enhances dependencies (non-recursively)

includeBasePkgs

If TRUE, include base R packages in results

Rversion

Version of R (only used if type is not source.) Defaults to R.version, but this can be specified as any of the following formats:

  • a character string with the two digit R version, e.g. "3.1"

  • a list with components major and minor

  • the result of getRversion()

  • the result of R.version()

quiet

If TRUE, suppresses warnings

...

Other arguments passed to available.packages()

See also

Other dependency functions: basePkgs, makeDepGraph, plot.pkgDepGraph

Examples

# NOT RUN { pkgDep(pkg = c("ggplot2", "plyr", "reshape2"), repos = c(CRAN = getOption("minicran.mran")) ) # }
pdb <- cranJuly2014
# NOT RUN { pdb <- pkgAvail(repos = c(CRAN = getOption("minicran.mran"))) # }
pkgDep(pkg = c("ggplot2", "plyr", "reshape2"), pdb)
#> [1] "ggplot2" "plyr" "reshape2" "digest" "gtable" #> [6] "scales" "proto" "MASS" "Rcpp" "stringr" #> [11] "RColorBrewer" "dichromat" "munsell" "labeling" "colorspace" #> [16] "SparseM" "lattice" "survival" "Formula" "latticeExtra" #> [21] "cluster" "maps" "sp" "foreign" "mvtnorm" #> [26] "TH.data" "sandwich" "zoo" "evaluate" "formatR" #> [31] "highr" "markdown" "mime" "nlme" "Matrix" #> [36] "codetools" "iterators" "quantreg" "Hmisc" "mapproj" #> [41] "hexbin" "maptools" "multcomp" "testthat" "knitr" #> [46] "mgcv" "abind" "foreach" "doMC" "itertools"