powered by
Returns a vector whose i'th element is the cumulative mean (arithmetic mean) of the i'th first elements of the argument.
i
cummean(x)
A vector of length length(x) with the cumulative mean. The i'th entry cummean(x)[i] equals mean(x[1:i]).
length(x)
cummean(x)[i]
mean(x[1:i])
a numeric vector.
Anders Ellern Bilgrau <anders.ellern.bilgrau@gmail.com>
cumsum
x <- sort(rnorm(100)) GMCM:::cummean(x)
Run the code above in your browser using DataLab