For testing, I have this small vector x where the long(er) way is giving me the results as expected version 1.0.0 cummean() is not.
library(tidyverse)
x <- 1:5
# long(er) way
cumsum(x) / seq_along(x)
#> [1] 1.0 1.5 2.0 2.5 3.0
# dplyr 0.8.5 cummean()
cummean(x)
#> [1] 1.0 1.5 2.0 2.5 3.0
# dplyr 1.0.0 cummean()
cummean(x)
#> [1] 1.000000 1.000000 1.333333 1.750000 2.200000
Created on 2020-05-31 by the reprex package (v0.3.0)
For testing, I have this small vector
xwhere the long(er) way is giving me the results as expected version 1.0.0cummean()is not.Created on 2020-05-31 by the reprex package (v0.3.0)