rep                   package:base                   R Documentation

_R_e_p_l_i_c_a_t_e _E_l_e_m_e_n_t_s

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

     `rep' replicates the values in `x' according to the values given
     in `times' and `length.out'.

     If `times' consists of a single integer, the result consists of
     the values in `x' repeated this many times. If `times' is a vector
     of the same length as `x', the result consists of `x[1]' repeated
     `times[1]' times, `x[2]' repeated `times[2]' times and so on.

     `length.out' may be given in place of `times', in which case `x'
     is repeated as many times as is necessary to create a vector of
     this length.

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

     rep(x, times, length.out)

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

     `seq', `sequence'.

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

     rep(1:4,2)
     rep(1:4,c(2,2,2,2))

