-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
This idea follows from the "Suggests" section of the R-pkgs book, where you provide the code:
if (!requireNamespace("pkg", quietly = TRUE)) {
stop("Package \"pkg\" needed for this function to work. Please install it.",
call. = FALSE)
}
Could this be useful as a new assertion,has_package()
?
assertthat::has_package("dplyr")
I'd be happy to make the PR if you think this might be useful. If so, some questions:
- Name:
has_package()
,has_packages()
, other? - Should the argument be
...
as unnamed, orpackages
which would be a character-vector of package names, or other?
Metadata
Metadata
Assignees
Labels
No labels