A tibble with the original data and additional columns containing the
cumulative means.
Arguments
.data
A data frame to augment.
.value
A column name or names for which to compute the cumulative mean.
.names
Optional. A character vector of names for the new cumulative
mean columns. Defaults to "auto", which generates names based on the original
column names.
.initial_value
A numeric value to start the cumulative mean from.
Defaults to 0.
Author
Steven P. Sanderson II, MPH
Details
The function takes a data frame and a column name (or names) and
computes the cumulative mean for each specified column, starting from an
initial value. If the column names are not provided, it will throw an error.