1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{fail_on_missing_package}
\alias{fail_on_missing_package}
\title{Check if R package can be loaded and fails loudly otherwise}
\usage{
fail_on_missing_package(pkg, min_version, call = NULL)
}
\arguments{
\item{pkg}{string}
\item{min_version}{optional minimum version needed}
\item{call}{Call to include in error message.}
}
\description{
Check if R package can be loaded and fails loudly otherwise
}
\examples{
f <- function() fail_on_missing_package("foobar")
try(f())
g <- function() fail_on_missing_package("stats")
g()
}
|