Is the package installed and a specific version?

isPackageVersion(x, op = ">=")

Arguments

x

character. Named character vector. Name corresponds to package name, and value corresponds to minimum version.

op

character(1). Mathematical operator. Defaults to less than or equal to.

Functions

  • isPackageVersion: Vectorized.

Note

Updated 2020-08-11.

Examples

## TRUE ==== isPackageVersion( x = c( "base" = packageVersion("base"), "utils" = packageVersion("utils") ), op = "==" )
#> base utils #> TRUE TRUE
## FALSE ==== isPackageVersion( x = c( "base" = packageVersion("base"), "utils" = packageVersion("utils") ), op = ">" )
#> [1] FALSE FALSE #> Cause: 2 failures #> pos value cause #> 1 1 base version check fail #> 2 2 utils version check fail