assert_packages: Assert that packages are loaded

Description Usage Arguments Value See Also Examples

Description

This function can be useful in writing package functions that use functions from packages that you "suggest". It asserts that these packages are available, and throws an informative error for those packages that are not.

Usage

1
assert_packages(packages, ...)

Arguments

packages

character vector of package names to check

...

character package names to check

Value

logical indicating success

See Also

R Packages book

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
  # put packages in a character vector
  assert_packages(c("base", "utils"))

  # or by themselves
  assert_packages("base", "utils")


## End(Not run)

vegawidget/vegablock documentation built on June 19, 2019, 9:56 p.m.