

cumsum {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_, _e_t_c_.

_U_s_a_g_e_:

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

_V_a_l_u_e_:

     A vector with the same length of `x', but whose ele-
     ments are the cumulative sums, products, minima or max-
     ima of those in `x'.  An `NA' value in `x' will the
     corresponding and following elements of the 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))

