dotsapply           package:HilbertVisGUI           R Documentation

_L_i_s_t _a_p_p_l_y _f_o_r '...' _a_r_g_u_m_e_n_t_s

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

     A kludge to get around a certain problem in using 'lapply' with
     ''...'' ellipsis function arguments.

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

     dotsapply( fun, ... )

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

     fun: A function that takes one argument

     ...: Arguments to which the function should be applied 

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

     "'dotsapply(fun,...)'" gives the same result as 'lapply(
     list(...), fun)'. However, the construction with "'list'", when
     used for variables enumerated explicitely, will result in their
     duplication. 

     Assume, for example, that you have three very large vectors 'a',
     'b', and 'c', whose lengths you wish to know. If your write
     "'lapply( list(a,b,c), length )'", R will duplicate all three
     vectors in memory when constructing the list, which results in
     unnecessary use of memory. The alternative "'dotsapply( length, a,
     b, c )'" avoids this. Of course, you could also write "'list(
     length(a), length(b), length(c) )'", which neither causes
     duplication.

     This last possibility is, however, not an option, if, instead of
     "'a,b,c'", you have ellipsed function arguments, i.e. literally
     "'...'". In this special case, 'dotsapply' comes in handy, and as
     this case arose in 'hilbertDisplay', I implemented 'dotsapply' as
     a kludge and export it from the package just in case somebody ahs
     use for it.

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

     A list of function values

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

     Simon Anders, EMBL-EBI, sanders@fs.tum.de

