Set Options with Consistency Checks
Utility function for setting options with some consistency checks.
attributes of the new settings in
checked for consistency with the model (often default)
check.options(new, name.opt, reset = FALSE, assign.opt = FALSE, envir = .GlobalEnv, check.attributes = c("mode", "length"), override.check = FALSE)
a named list
character with the name of R object containing the default list.
TRUE, reset the options from
name.opt. If there is more than one R object with name
name.opt, remove the first one in the
TRUE, assign the …
character containing the attributes which
logical vector of length
length(new)(or 1 which entails recycling). For those
override.check[i] == TRUE, the checks are overridden and the changes made anyway.
A list of components with the same names as the one called
The values of the components are changed from the
as long as these pass the checks (when these are not overridden
"names" is exempt from all the checks or warnings, as in
the application it can be
NULL or a variable-length character
(L1 <- list(a = 1:3, b = pi, ch = "CH")) check.options(list(a = 0:2), name.opt = "L1") check.options(NULL, reset = TRUE, name.opt = "L1")