assertthat icon indicating copy to clipboard operation
assertthat copied to clipboard

Assert packages, fixes #49

Open ijlyttle opened this issue 6 years ago • 0 comments

A new function, assert_packages(), can be used in place of code suggested by R Packages.

Instead of this:

if (!requireNamespace("pkg", quietly = TRUE)) {
  stop("Package \"pkg\" needed for this function to work. Please install it.", call. = FALSE)
}

You can use this:

assertthat::assert_packages("pkg")

This PR fixes #49:

  • adds assert_packages() to new file R/assert-packages.R
  • adds tests in new file tests/testthat/test-packages/R
  • updates Roxygen to 6.1.1, roxygenizes package
  • adds item to NEWS

ijlyttle avatar Mar 03 '19 15:03 ijlyttle