cumsum                 package:base                 R Documentation

_C_u_m_u_l_a_t_i_v_e _S_u_m_s, _P_r_o_d_u_c_t_s, _a_n_d _E_x_t_r_e_m_e_s

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

     Returns a vector whose elements are the cumulative sums, products,
     minima or maxima of the elements of the argument.

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

     cumsum(x)
     cumprod(x)
     cummax(x)
     cummin(x)

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

       x: a numeric object.

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

     An `NA' value in `x' causes the corresponding and following
     elements of the return value to be `NA'.

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

     cumsum(1:10)
     cumprod(1:10)
     cummin(c(3:1, 2:0, 4:2))
     cummax(c(3:1, 2:0, 4:2))

