pac_deps: Package dependencies

View source: R/deps.R

pac_depsR Documentation

Package dependencies

Description

Package dependencies from DESCRIPTION files with installed or expected versions or newest released.

Usage

pac_deps(
  pac,
  fields = c("Depends", "Imports", "LinkingTo"),
  lib.loc = .libPaths(),
  base = FALSE,
  local = TRUE,
  description_v = FALSE,
  attr = TRUE,
  recursive = TRUE,
  repos = biocran_repos()
)

Arguments

pac

character a package name.

fields

a character vector listing the types of dependencies, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"). Character string "all" is shorthand for that vector, character string "most" for the same vector without "Enhances", character string "strong" (default) for the first three elements of that vector. Default: c("Depends", "Imports", "LinkingTo")

lib.loc

character vector, used optionally when local is equal TRUE. Default: .libPaths()

base

logical if to add base packages too. If TRUE then pacs::pacs_base() are taken into account. Default: FALSE

local

logical if to use local repository or newest CRAN packages, where by default local packages are used. Default: TRUE

description_v

if the dependencies version should be taken from description files, minimal required. By default installed versions are taken. Default: FALSE

attr

logical specify if a package and its version should be added as a attribute of data.frame or for FALSE as an additional record. Default: TRUE

recursive

logical If to assess the dependencies recursively. Default: TRUE

repos

character vector URLs of the repositories to use. By default checking CRAN and newest Bioconductor per R version. Default pacs::biocran_repos()

Value

data.frame with packages and their versions. Versions are taken from installed.packages or newest released.

Note

When function is invoked in the loop afterwards results could be aggregated like, stats::aggregate(results[, c("Version"), drop = FALSE], list(Package = results$Package), pacs::compareVersionsMax).

Examples

## Not run: 
pacs::pac_deps("stats", base = TRUE)$Package
pacs::pac_deps("memoise")$Package
pacs::pac_deps("memoise", description_v = FALSE)
# raw dependencies from DESCRIPTION file
pacs::pac_deps("memoise", description_v = TRUE, recursive = FALSE)
# raw dependencies from DESCRIPTION file - last release
pacs::pac_deps("memoise", description_v = TRUE, local = FALSE, recursive = FALSE)

## End(Not run)

pacs documentation built on May 11, 2022, 1:09 a.m.