getDefaults: Show Global Defaults List By Function

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Show global Default list by function or specified argument values by function.

Usage

1

Arguments

name

name of function, quoted or unquoted

arg

values to retrieve

Details

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)

Value

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)

Author(s)

Jeffrey A. Ryan

See Also

setDefaults, useDefaults, options

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)    # DEFUNCT as of 2.0-0
my.fun 

my.fun()                #returns 8 
my.fun(y=10)            #returns 1024 
my.fun(x=2,y=10)        #returns 1024 

#unDefaults(my.fun)     # DEFUNCT as of 2.0-0
my.fun 
my.fun()                #returns 2 

getDefaults(my.fun) 
unsetDefaults(my.fun,confirm=FALSE) 
getDefaults(my.fun) 

joshuaulrich/Defaults documentation built on May 19, 2019, 8:54 p.m.