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

