Returns the version of the specified pkg dependency from a DESCRIPTION file.
Usage
desc_dep_vrsn(
pkg,
file = ".",
types = c("Imports", "Depends", "Suggests", "Enhances", "LinkingTo")
)Arguments
- pkg
R package name. A character scalar. Defaults to the name of the calling package.
- file
DESCRIPTION file to use. By default the DESCRIPTION file of the current package (i.e. the package the working directory is part of) is used.
- types
Dependency types to be considered. If
pkgis listed in multiple dependency types, the maximally required version is returned.
See also
Other package DESCRIPTION functions:
desc_get_field_safe(),
desc_list(),
desc_url_git()
Examples
fs::path_package(package = "dplyr") |> pal::desc_dep_vrsn(pkg = "tibble")
#> [1] ‘3.2.0’
