Description Usage Arguments Details
Raising Classed conditions helps with catching errors. These allow for typing errors as they arise and adding scopes to better catch errors from specific locations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | condition(
msg,
cond = .conditions,
...,
scope = find_scope(),
type = NULL,
call = sys.call(1)
)
pkg_error(msg, ..., scope = find_scope(), call = sys.call(1))
pkg_warning(msg, ..., scope = find_scope(), call = sys.call(1))
pkg_message(msg, ..., scope = find_scope(), call = sys.call(1))
|
msg |
The message to convey |
cond |
The severity of the condition, or what to do; give a 'message' (default), a 'warning', an 'error' or do 'none' and ignore. |
... |
Attributes to be added to condition object for |
scope |
A character vector of the scope(s) of the signal. Defaults to the package name but could be longer such as package name, a class name, and a method call. This should be used as a where the error occurred. |
type |
Used with |
call |
The call to use to include in the condition. |
The condition()
function alone provides a flexible and dynamic way of
producing conditions in code. The functions pkg_error
, pkg_warning
,
and pkg_message
do the same as condition except restricted to errors, warnings,
and messages respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.