View source: R/control.utilities.R
check.control.class | R Documentation |
This function converts an ordinary list
into a control list (if
needed) and checks that the control list passed is appropriate for
the function to be controlled.
check.control.class(
OKnames = as.character(ult(sys.calls(), 2)[[1L]]),
myname = as.character(ult(sys.calls(), 2)[[1L]]),
control = get("control", pos = parent.frame())
)
OKnames |
List of control function names which are acceptable. |
myname |
Name of the calling function (used in the error message). |
control |
The control list or a list to be converted to a
control list using |
check.control.class()
performs the check by looking up
the class of the control
argument (defaulting to the control
variable in the calling function) and checking if it matches a
list of acceptable given by OKnames
.
Before performing any checks, the control
argument (including
the default) will be converted to a control list by calling
as.control.list()
on it with the first element of OKnames
to
construct the control function.
If control
is missing, it will be assumed that the user wants
to modify it in place, and a variable with that name in the
parent environment will be overwritten.
A valid control list for the function in which it is to be
used. If control
argument is missing, it will also overwrite
the variable control
in the calling environment with it.
In earlier versions, OKnames
and myname
were
autodetected. This capability has been deprecated and results in
a warning issued once per session. They now need to be set
explicitly.
set.control.class()
, print.control.list()
, as.control.list()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.