Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert packages, fixes #49 #56

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ijlyttle
Copy link

@ijlyttle ijlyttle commented Mar 3, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: has_package()
1 participant