Skip to contents

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

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 pkg is listed in multiple dependency types, the maximally required version is returned.

Value

A numeric version.

See also

Other package DESCRIPTION functions: desc_list(), desc_url_git(), desc_value()

Examples

fs::path_package(package = "dplyr") |> pal::desc_dep_vrsn(pkg = "tibble")
#> [1] ‘3.2.0’