File: fail_on_missing_package.Rd

package info (click to toggle)
r-cran-logger 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,324 kB
  • sloc: sh: 13; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
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()
}