Skip to contents

Test if a package is available on CRAN

Usage

is_pkg_cran(pkg, min_version = NULL, max_tries = 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.

max_tries

Maximum number of request attempts in case of an HTTP error. An integerish scalar. Retries are performed using exponential backoff and jitter, see httr2::req_retry() for details.

Value

A logical scalar.

See also

Other R package functions: 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