getDefaults             package:Defaults             R Documentation

_S_h_o_w _G_l_o_b_a_l _D_e_f_a_u_l_t_s _L_i_s_t _B_y _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     getDefaults(name=NULL, arg = NULL)

_A_r_g_u_m_e_n_t_s:

    name: name of function, quoted or unquoted 

     arg: values to retrieve 

_D_e_t_a_i_l_s:

     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)'

_V_a_l_u_e:

     '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')

_A_u_t_h_o_r(_s):

     Jeffrey A. Ryan

_S_e_e _A_l_s_o:

     'setDefaults', 'useDefaults', 'options'

_E_x_a_m_p_l_e_s:

     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) 

