pls.options {pls} | R Documentation |
A function to set options for the pls package, or to return the current options.
pls.options(...)
... |
a single list, a single character vector, or any number of named arguments (name = value). |
If called with no arguments, or with an empty list as the single
argument, pls.options
returns the current options.
If called with a character vector as the single argument, a list with the arguments named in the vector are returned.
If called with a non-empty list as the single arguments, the list elements should be named, and are treated as named arguments to the function.
Otherwise, pls.options
should be called with one or more named
arguments name = value. For each argument, the option named
name will be given the value value.
The options are saved in a variable .pls.Options
in the global
environment, and remain in effect until the end of the session. If
the environment is saved upon exit, they will be remembered in the
next session. The ‘factory defaults’ can be restored by removing
.pls.Options
from the global environment.
The recognised options are:
mvr
and
mvrCv
. The value should be one of the allowed
methods. Defaults to "kernelpls"
. Can be overridden with
the argument method
in mvr
and mvrCv
.pcr
. The
value should be one of the allowed methods. Defaults to
"svdpc"
. Can be overridden with the argument
method
in pcr
.plsr
. The
value should be one of the allowed methods. Defaults to
"kernelpls"
. Can be overridden with the argument
method
in plsr
.A list with the (possibly changed) options. If any named argument (or list element) was provided, the list is returned invisibly.
If any named argument (or list element) was provided,
pls.options
updates the elements of the option list
.pls.Options
in the global environment.
The function is a slight modification of the function
sm.options
from the package sm.
Bjørn-Helge Mevik and Ron Wehrens
## Return current options: pls.options() pls.options("plsralg") pls.options(c("plsralg", "pcralg")) ## Set options: pls.options(plsralg = "simpls", mvralg = "simpls") pls.options(list(plsralg = "simpls", mvralg = "simpls")) # Equivalent pls.options() ## Restore `factory settings': rm(.pls.Options) pls.options()