getDefaults {Defaults} | R Documentation |
Show global Default list by function or specified argument values by function.
getDefaults(name=NULL, arg = NULL)
name |
name of function, quoted or unquoted |
arg |
values to retrieve |
A list of function names currently with
Defaults set can be seen by calling getDefaults()
with no arguments.
This does not imply that the returned function
names are currently set to accept defaults (via
useDefaults
or hard-coded with
importDefaults
, rather that they have been
set up to store user Defaults.
All values can be viewed less elegantly by a call
to getOption(name_of_function.Default)
getDefaults
returns a named list of defaults
and associated values, similar to formals
, only
returning setDefaults
set values for the
name
function. Single arguments need
not be quoted, multiples must be as a character
vector. Calling getDefaults()
without
arguments results in a character vector of
all functions currently having Defaults set
(by setDefaults
)
Jeffrey A. Ryan
setDefaults
,
useDefaults
,
options
setDefaults(lm,na.action='na.exclude',singular.ok=TRUE) getDefaults() getDefaults(lm) unsetDefaults(lm,confirm=FALSE) getDefaults(lm) my.fun <- function(x=2,y=1) { x ^ y } my.fun() #returns 2 my.fun(x=2,y=10) #returns 1024 setDefaults(my.fun,x=2,y=3) useDefaults(my.fun) my.fun my.fun() #returns 8 my.fun(y=10) #returns 1024 my.fun(x=2,y=10) #returns 1024 unDefaults(my.fun) my.fun my.fun() #returns 2 getDefaults(my.fun) unsetDefaults(my.fun,confirm=FALSE) getDefaults(my.fun)