get_package_version: Query Installed Package Version

View source: R/get_package_version.R

get_package_versionR Documentation

Query Installed Package Version

Description

packageVersion converts to class package_version, which then again would need to be converted for compareVersion. So this is a modified copy of packageVersion skipping the conversion to package_version.

Usage

get_package_version(x, lib_loc = NULL)

Arguments

x

A character giving the package name.

lib_loc

See argument lib.loc in packageDescription.

Value

A character giving the package version.

See Also

Other version functions: is_r_package_installed(), is_version_sufficient()

Other package functions: is_r_package_installed(), is_version_sufficient(), load_internal_functions()

Examples

get_package_version("base")
try(get_package_version("mgcv"))
utils::compareVersion("1000.0.0", get_package_version("base"))
utils::compareVersion("1.0", get_package_version("base"))
# from ?is_version_sufficient:
is_version_sufficient(installed = get_package_version("base"),
                      required = "1.0")

fritools documentation built on Nov. 19, 2023, 1:06 a.m.