Skip to contents

Test if a package is available on CRAN

Usage

is_pkg_cran(pkg, min_version = NULL, retries = 1L)

Arguments

pkg

Package name (case-sensitive). A character scalar.

min_version

Minimum required version number of pkg. Must be either NULL to ignore version numbers, or a single package_version or something coercible to.

retries

Maximum number of retries of the HEAD request in case of an HTTP error. An integer scalar >= 0. The retries are performed using exponential backoff and jitter, see httr::RETRY() for details.

Value

A logical scalar.

See also

Other R package functions: assert_pkg(), is_pkg_dir(), is_pkg_installed(), is_pkgdown_dir(), ls_pkg(), use_pkg()

Examples

pal::is_pkg_cran("foobar")
#> [1] FALSE
pal::is_pkg_cran("dplyr")
#> [1] TRUE
pal::is_pkg_cran("dplyr", min_version = "9999.9")
#> [1] FALSE