# see example, from a vector a, we compute a rolling mean of a sliding windows
# with either 2 values before or more smooth with 7
tibble(a = c(1, 3, 5, 6, 8, 13, 15),
a_avg_2 = slider::slide_mean(a, before = 2),
a_avg_7 = slider::slide_mean(a, before = 7))
# A tibble: 7 × 3
a a_avg_2 a_avg_7
<dbl> <dbl> <dbl>
1 1 1 1
2 3 2 2
3 5 3 3
4 6 4.67 3.75
5 8 6.33 4.6
6 13 9 6
7 15 12 7.29