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'.

     These are generic functions: methods can be defined for them
     individually or via the 'Math' group generic.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole. ('cumsum' only.)

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

