Skip to contents

This function queries the selected repositories for dependencies of the selected packages and returns the first working occurence.

Usage

wood_dependencies(packages, repos = "cran")

Arguments

packages

character()
Names of the packages to query for.

repos

character()
A vector of repositories to query. The following values are available:

  • "cran", meaning CRAN;

  • "bioc@release", meaning Bioconductor, where release should be replaced with a valid Bioconductor release code or one of "release", "devel";

  • "github/user", meaning GitHub, where user should be replaced with a valid user or organization name (e.g. turtletopia);

  • "runiverse@universe", meaning R-universe, where universe should be replaced with a valid universe name (e.g. turtletopia);

  • "local#index", meaning a local library, where index should be replaced with an integer index of a library in base::.libPaths() or an all keyword;

  • "core", meaning base R packages;

  • a URL if none of the above is matched.

Value

A list named after queried packages, each element being a data frame with three columns, all in string format:

  • package (package name),

  • version (minimum version requirement or NA if none),

  • type (dependency type, e.g. "Imports").

Examples

# \donttest{
wood_dependencies("stats", "core")
#> <woodendesc dependency list [1]>
#>  <stats dependencies>
#>   Imports:     utils
#>   Imports:     grDevices
#>   Imports:     graphics
#>   Suggests:    MASS
#>   Suggests:    Matrix
#>   Suggests:    SuppDists
#>   Suggests:    methods
#>   Suggests:    stats4
#> 
# Multiple packages are also possible:
wood_dependencies(
  c("tibble", "Biostrings", "woodendesc"),
  repos = c("runiverse@turtletopia", "cran", "bioc@1.5")
)
#> <woodendesc dependency list [3]>
#>  <tibble dependencies>
#>   Depends:     R (>= 3.4.0)
#>   Imports:     fansi (>= 0.4.0)
#>   Imports:     lifecycle (>= 1.0.0)
#>   Imports:     magrittr
#>   Imports:     methods
#>   Imports:     pillar (>= 1.8.1)
#>   Imports:     pkgconfig
#>   Imports:     rlang (>= 1.0.2)
#>   Imports:     utils
#>   Imports:     vctrs (>= 0.4.2)
#>   Suggests:    bench
#>   Suggests:    bit64
#>   Suggests:    blob
#>   Suggests:    brio
#>   Suggests:    callr
#>   Suggests:    cli
#>   Suggests:    covr
#>   Suggests:    crayon (>= 1.3.4)
#>   Suggests:    DiagrammeR
#>   Suggests:    dplyr
#>   Suggests:    evaluate
#>   Suggests:    formattable
#>   Suggests:    ggplot2
#>   Suggests:    here
#>   Suggests:    hms
#>   Suggests:    htmltools
#>   Suggests:    knitr
#>   Suggests:    lubridate
#>   Suggests:    mockr
#>   Suggests:    nycflights13
#>   Suggests:    pkgbuild
#>   Suggests:    pkgload
#>   Suggests:    purrr
#>   Suggests:    rmarkdown
#>   Suggests:    stringi
#>   Suggests:    testthat (>= 3.0.2)
#>   Suggests:    tidyr
#>   Suggests:    withr
#> 
#>  <Biostrings dependencies>
#>   Depends:     R (>= 1.8.0)
#> 
#>  <woodendesc dependencies>
#>   Depends:     R (>= 3.5.0)
#>   Imports:     digest
#>   Imports:     httr
#>   Imports:     versionsort (>= 1.1.0)
#>   Suggests:    covr
#>   Suggests:    httptest
#>   Suggests:    testthat (>= 3.0.0)
#>   Suggests:    usethis
#>   Suggests:    vcr
#>   Suggests:    withr
#>   Suggests:    xml2
#> 
# By default, only CRAN is queried:
wood_dependencies("versionsort")
#> <woodendesc dependency list [1]>
#>  <versionsort dependencies>
#>   Suggests:    covr
#>   Suggests:    spelling
#>   Suggests:    testthat (>= 3.0.0)
#> 
# }