| check_xxx_help | R Documentation |
Conditionally bank error messages in the immediate environment of a function to allow for exhaustive error checking before throwing an exception. Results in a possibly multiple-error, accumulated message to be processed upon completion of error checking.
check_xxx_help()
check_t(..., .d = " ")
check_tf(...)
check_lgl(..., .na = FALSE, .extras = NULL)
check_nll_or(.funs, ..., .vals = NULL)
check_nas_or(.funs, ..., .vals = NULL)
check_cls(.cls, ...)
check_pop(...)
check_funs(.funs, ..., .vals = NULL)
check_spec(.spec, ..., .na = F)
check_vals(.vals, ..., .a = TRUE, .na = FALSE)
check_chars(.chars, ..., .a = TRUE)
check_dots(.spec, ..., .named = FALSE)
check_when(.whens, .vals, ...)
check_fail(...)
... |
Differs by function in terms of whether they are named, how many there are, and their property requirements as described in the functions section. |
.d |
A non- |
.na |
A logical scalar indicating whether |
.extras |
|
.funs |
A complete character vec containing |
.vals |
A complete atomic object of length |
.spec |
A complete character scalar containing a property spec. |
.a |
A logical scalar indicating whether to atomize |
.chars |
A complete string object containing |
.named |
A logical scalar indicating whether |
.whens |
A populated atomic object of length |
.fun |
A character scalar naming the function generating an error or errors. |
**A **simpleError object
getterr
A character vector
banked_Errs
All others are called for their side effects.
check_t(): Checks named ... arguments for scalar TRUE-ness. If any named ... argument is not scalar TRUE, collapses unnamed ... args to an error message template, replacing the escape sequence '{@}' with each non-qualifying named ... arg's name.
check_tf(): Checks named ... arguments for scalar TRUE-ness or scalar FALSE-ness. If any named ... argument is neither scalar TRUE nor scalar FALSE, banks an error indicating that the argument must be scalar TRUE or scalar FALSE. NOTE: unnamed ... arguments are not valid.
check_lgl(): Checks each named ... arg for scalar TRUE-ness, scalar FALSE-ness, scalar NA-ness (if .na is scalar TRUE), or scalar membership in .extras (when .extras is a complete atomic object). Banks an error for each ... that does not qualify. NOTE: unnamed ... arguments are not valid.
check_nll_or(): Checks each named ... argument for NULL-ness or for any property describe by any property function named in character argument .funs. Banks an automatically-generated error message for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_nas_or(): Checks each named ... argument for scalar NA-ness or for any property describe by any property function named in character argument .funs. Banks an automatically-generated error message for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_cls(): Checks each named ... argument for any one the classes named in character argument .cls. Banks an automatically-generated error message for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_pop(): Checks each named ... for populated-ness (i.e., non-NULL and not of length 0). Banks an error for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_funs(): Checks each named ... argument for a match to any of the property functions named in .funs, and if there is a match and atomic argument .vals is non-NULL, whether the values are all contained in atomic argument .vals. Banks an error for each ... argument that does not qualify. NOTE: Unname ... arguments are not valid.
check_spec(): Checks each named ... argument for a match to the property spec in character argument .spec with the additional check for disallowed NA values if logical scalar argument .na = FALSE. Banks an error for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_vals(): Checks each named ... argument for atomic-ness and for containing only the atomic values given in .vals. Banks an error for each non-qualifying ... argument. NOTE: Unnamed ... arguments are not valid.
check_chars(): Checks each named ... argument (assumed to be of mode 'character') for whether it contains only the characters contained in the character argument .chars. When .a = TRUE, atomizes ... before value checking. Banks an error for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
check_dots(): Checks each ... argument for a match to at least one value of the property spec on character argument .spec. Optionally checks whether all ... arguments are named (when .named = TRUE). Banks an error for missing ... argument names (if there are an missing names and .named = TRUE). Also banks an error for any non-qualifying ... argument. for whether it contains only the characters contained in the character argument .chars. When .a = TRUE, atomizes ... before value checking. Banks an error for each ... argument that does not qualify.
check_when(): Assumes two named, atomic, scalar ... arguments. Checks that the value of the second named ... argument is appropriate given the value of the first ... argument by identifying which element of .whens is equal to the value of the first ... argument, and checking the corresponding element of .vals against the second ... argument. Banks an error if the value of the first and the value of the second ... arguments do not pass the check. NOTE: There must be only two named ... arguments and unnamed ... arguments are not valid.
check_fail(): Checks each named ... argument for validity (i.e., evaluating an argument does not produce an error). Banks an error for each ... argument that does not qualify. NOTE: Unnamed ... arguments are not valid.
Other Errs:
stopperr()
egStopper <- function() {stopperr('stopper demo')}
egErrs <- function() {Errs('Errs demo1', 'Errs demo2')}
egErr <- function() {err('err', 'demo')}
egErrors <- function(..., tf = NA, lgl = 42, not = FALSE, pop = NULL,
fail = simpleError('error'), funs = 2:4, spec = 42,
vals = 42, class = 42, nas.or = NULL, nll.or = NA,
chars = '5', when.a = "error.a", when.b = "error.b") {
bankerr(...elt(1))
bankErrs(...elt(2), ...elt(3))
check_tf(tf = tf)
check_lgl(lgl = lgl)
check_t(not = not)
check_pop(pop = pop)
check_fail(fail = fail)
check_funs(c('cmp_ch1_vec', 'cmp_ngw_vec'), funs = funs)
check_spec('cmp_ch1_vec|nll|nas', spec = spec)
check_vals(letters, vals = vals)
check_cls('data.frame', class)
check_nas_or(c('cmp_ch1_vec', 'cmp_ngw_vec'), nas.or = nas.or)
check_nll_or(c('cmp_ch1_vec', 'cmp_ngw_vec'), nll.or = nll.or)
check_chars(letters, chars = chars)
check_when(when.a = when.a, when.b = when.b, c('error.a', ''), c('error.b', ''))
checkerr()
}
## Not run:
egstopperr()
getterr()
purgerr()
getter()
egErrs()
egErrs()
egErrors()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.