cummean function

Cumulative mean values

Cumulative mean values

Returns a vector whose i'th element is the cumulative mean (arithmetic mean) of the i'th first elements of the argument.

cummean(x)

Arguments

  • x: a numeric vector.

Returns

A vector of length length(x) with the cumulative mean. The i'th entry cummean(x)[i] equals mean(x[1:i]).

Examples

x <- sort(rnorm(100)) GMCM:::cummean(x)

See Also

cumsum

Author(s)

Anders Ellern Bilgrau anders.ellern.bilgrau@gmail.com

  • Maintainer: Anders Ellern Bilgrau
  • License: GPL (>= 2)
  • Last published: 2019-11-05