Skip to contents

The specified package version is extracted and returned. This can simply be the version installed from CRAN or if a development version from GitHub is used details from that will be returned.

Usage

fetch_package_version(pkgname)

Arguments

pkgname

Name of package

Value

String with the version information

Examples

# This package should exist
fetch_package_version('digest')
#> $isgood
#> [1] TRUE
#> 
#> $msgs
#> NULL
#> 
#> $version_verb
#> [1] "0.6.33 (2023-07-07, CRAN (R 4.2.0))"
#> 
#> $version
#> [1] "0.6.33"
#> 

# This package should not exist
fetch_package_version('bad package name')
#> $isgood
#> [1] FALSE
#> 
#> $msgs
#> [1] "The package: bad package name was not found. You may need to load it first."
#> 
#> $version_verb
#> [1] "NA"
#> 
#> $version
#> [1] "NA"
#>