Skip to contents

Get package version from lockfile

Usage

get_version_pkg(x, pkg = "renv")

Arguments

x

A 'rt_list' or 'rt_tibble' class object. An single output from read_lock().

pkg

package name with correct case

Value

A character string with version or NA

Examples

paths <- file.path(system.file("extdata", package = "renvtools"), "renv-r4.4.1.lock")
l <- read_lock(paths, format = "list")
get_version_pkg(l, "renv")
#> [1] "1.0.7"