Skip to contents

This function queries CRAN for dependencies of the selected version of a selected package. By default, it queries the latest version.

Usage

wood_cran_dependencies(package, version = "latest")

Arguments

package

character(1)
Name of a package to query for.

version

character(1)
A version code without leading "v", e.g. "1.6.0".

Value

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_cran_dependencies("deepdep")
#> <dependencies>
#>   Depends:     R (>= 3.2.0)
#>   Imports:     cranlogs
#>   Imports:     httr
#>   Imports:     jsonlite
#>   Suggests:    BiocManager
#>   Suggests:    covr
#>   Suggests:    devtools
#>   Suggests:    ggplot2
#>   Suggests:    ggraph
#>   Suggests:    graphlayouts
#>   Suggests:    igraph
#>   Suggests:    knitr
#>   Suggests:    miniCRAN
#>   Suggests:    plyr
#>   Suggests:    rmarkdown
#>   Suggests:    scales
#>   Suggests:    shiny
#>   Suggests:    shinycssloaders
#>   Suggests:    spelling
#>   Suggests:    stringi
#>   Suggests:    testthat (>= 2.1.0)
#>   Suggests:    vcr
wood_cran_dependencies("ggplot2", version = "3.4.0")
#> <dependencies>
#>   Depends:     R (>= 3.3)
#>   Imports:     cli
#>   Imports:     glue
#>   Imports:     grDevices
#>   Imports:     grid
#>   Imports:     gtable (>= 0.1.1)
#>   Imports:     isoband
#>   Imports:     lifecycle
#>   Imports:     MASS
#>   Imports:     mgcv
#>   Imports:     rlang (>= 1.0.0)
#>   Imports:     scales (>= 1.2.0)
#>   Imports:     stats
#>   Imports:     tibble
#>   Imports:     vctrs (>= 0.5.0)
#>   Imports:     withr (>= 2.5.0)
#>   Suggests:    covr
#>   Suggests:    dplyr
#>   Suggests:    ggplot2movies
#>   Suggests:    hexbin
#>   Suggests:    Hmisc
#>   Suggests:    knitr
#>   Suggests:    lattice
#>   Suggests:    mapproj
#>   Suggests:    maps
#>   Suggests:    maptools
#>   Suggests:    multcomp
#>   Suggests:    munsell
#>   Suggests:    nlme
#>   Suggests:    profvis
#>   Suggests:    quantreg
#>   Suggests:    ragg
#>   Suggests:    RColorBrewer
#>   Suggests:    rgeos
#>   Suggests:    rmarkdown
#>   Suggests:    rpart
#>   Suggests:    sf (>= 0.7-3)
#>   Suggests:    svglite (>= 1.2.0.9001)
#>   Suggests:    testthat (>= 3.1.2)
#>   Suggests:    vdiffr (>= 1.0.0)
#>   Suggests:    xml2
#>   Enhances:    sp
# }