R/package_installed.R

Defines functions package_installed

Documented in package_installed

#' Is a package installed?
#' @param pkg Package name.
#' @returns Boolean. True if package is installed, false if not.
#' @examples
#' org::package_installed("data.table")
#' @export
package_installed <- function(pkg){
  pkgs <- utils::installed.packages()[,"Package"]
  return(pkg %in% pkgs)
}

Try the org package in your browser

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

org documentation built on June 22, 2024, 10:37 a.m.