doCall                package:R.utils                R Documentation

_E_x_e_c_u_t_e_s _a _f_u_n_c_t_i_o_n _c_a_l_l _w_i_t_h _o_p_t_i_o_n _t_o _i_g_n_o_r_e _u_n_u_s_e_d _a_r_g_u_m_e_n_t_s

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

     Executes a function call with option to ignore unused arguments.

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

     ## Default S3 method:
     doCall(.fcn, ..., args=NULL, alwaysArgs=NULL, .functions=.fcn, .ignoreUnusedArgs=TRUE)

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

    .fcn: A 'character' string naming the function to be called.

     ...: Named arguments to be passed to the function.

    args: A 'list' of additional named arguments that will be appended
          to the above arguments.

alwaysArgs: A 'list' of additional named arguments that will be
          appended to the above arguments and that will _never_ be
          ignore. This is useful if you want to pass arguments to a
          function that accepts arguments via '...'.

.functions: A 'character' 'vector' of function names whos arguments
          should be kept. This is useful when one function passes '...'
          to another, e.g. 'loess'.

.ignoreUnusedArgs: If 'TRUE', arguments that are not accepted by the
          function, will not be passed to it. Otherwise, all arguments
          are passed.

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

     Henrik Bengtsson (<URL: http://www.braju.com/R/>).

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

     'do.call'().

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

       doCall("plot", x=1:10, y=sin(1:10), col="red", dummyArg=54,
              alwaysArgs=list(xlab="x", ylab="y"),
              .functions=c("plot", "plot.xy"))

