err {chk} | R Documentation |
Stop, Warning and Message Messages
Description
The functions call message_chk()
to process
the message and then
rlang::abort()
, rlang::warn()
and
rlang::inform()
, respectively.
Usage
err(
...,
n = NULL,
tidy = TRUE,
.subclass = NULL,
class = NULL,
call = rlang::caller_call(3)
)
wrn(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL)
msg(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL)
Arguments
... |
zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object. |
n |
The value of n for converting |
tidy |
A flag specifying whether capitalize the first character and add a missing period. |
.subclass |
A string of the class of the error message. |
class |
Subclass of the condition. |
call |
The execution environment of a currently running
function, e.g. You only need to supply Can also be For more information about error calls, see Including function calls in error messages. |
Details
The user can set the subclass.
Functions
-
err()
: Error -
wrn()
: Warning -
msg()
: Message
Examples
# err
try(err("there %r %n problem value%s", n = 2))
# wrn
wrn("there %r %n problem value%s", n = 2)
# msg
msg("there %r %n problem value%s", n = 2)