Closed joshuaulrich closed 1 year ago
x <- c(rep(NA_real_, 5), 1:5) TTR::runMean(x, 1, cumulative = TRUE) ## [1] NA NA NA NA NA NA 0.4285714 0.7500000 1.1111111 1.5000000 # but the non-NA values should be cumsum(1:5) / 1:5 ## [1] 1.0 1.5 2.0 2.5 3.0