R/is_package_installed.R

Defines functions is_package_installed

#' Check if package is installed
#'
#' This function tests if a package is installed. Its main purpose is for use
#' together with mocking in testthat.
#'
#' @param package Package name.
#'
#' @return Logical.
#' @noRd
#'
#' @examples
#' is_package_installed("dplyr")
is_package_installed <- function(package) {
  requireNamespace(package, quietly = TRUE)
}

Try the rifttable package in your browser

Any scripts or data that you put into this service are public.

rifttable documentation built on June 8, 2025, 1:52 p.m.