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.35 (2024-03-11, CRAN (R 4.2.3))"
#> 
#> $version
#> [1] "0.6.35"
#> 

# 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"
#>