Retrieves package dependencies.

Description

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

Usage

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

Arguments

pkg

Character vector of packages.

availPkgs

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. Can be specified as a character string with the two digit R version, e.g. "3.1". Defaults to R.version

...

Other arguments passed to available.packages

See Also

Other dependency functions: basePkgs, makeDepGraph, plot.pkgDepGraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
pkgDep(pkg = c("ggplot2", "plyr", "reshape2"), 
       repos = c(CRAN = "http://mran.microsoft.com")
)

## End(Not run)

pdb <- cranJuly2014
## Not run: 
pdb <- pkgAvail(repos = c(CRAN = "http://mran.microsoft.com"))

## End(Not run)

pkgDep(pkg=c("ggplot2", "plyr", "reshape2"), pdb)