mapply                 package:base                 R Documentation

_A_p_p_l_y _a _f_u_n_c_t_i_o_n _t_o _m_u_l_t_i_p_l_e _l_i_s_t _o_r _v_e_c_t_o_r _a_r_g_u_m_e_n_t_s

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

     A multivariate version of 'sapply'. 'mapply' applies 'FUN' to the
     first elements of each ... argument, the second elements, the
     third elements, and so on. Arguments are recycled if necessary.

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

     mapply(FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE, USE.NAMES = TRUE)

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

     FUN: Function to apply 

     ...: Arguments to vectorise over (list or vector) 

MoreArgs: A list of other arguments to 'FUN' 

SIMPLIFY: Attempt to reduce the result to a vector or matrix? 

USE.NAMES: If the first ... argument is character and the result
          doesn't already have names, use it as the names

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

     A list, vector, or matrix.

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

     'sapply', 'outer'

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

     mapply(rep, 1:4, 4:1)

     mapply(rep, times=1:4, x=4:1)

     mapply(rep, times=1:4, MoreArgs=list(x=42))

