# NOT RUN {
n_vars <- 10
n_obs <- 1000
data <- matrix(rnorm(n_obs * n_vars), nrow = n_obs, ncol = n_vars)
# Rolling means
result <- roll_mean(data, 252)
# Rolling means with exponential decay
weights <- 0.9 ^ (251:0)
result <- roll_mean(data, 252, weights)
# }
Run the code above in your browser using DataLab