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

