Add option to calculate/plot rolling averages
zkamvar opened this issue · comments
This comes from R4EPI/sitrep#70 (comment)
This would be related to #104 since the underlying function could be added as a ggplot2 stat.
When this package hits CRAN, it will be good: https://davisvaughan.github.io/slide/
slide function currently already on CRAN as part of the {tsibble} package (but to be deprecated in favour of {slide} mentioned by zhian)
I've thought a lot about this (in #104 and #76 ). I've toyed around with {tsibble} and I get the feeling that it basically does what we want to turn incidence into. It presents a new class that tracks time variables and intervals in a tidy data frame. This is how it can do windowing.
Honestly, I think the way to go is to wrap a lot of the {incidence} functionality around {tsibble}. What we have in {incidence} is good for quick visualizations, but it's not very flexible since it summarizes the data from the start. The {tsibble} package has a few advantages in that it's widely used, maintained by a team dedicated to timeseries, and builds the objects incrementally.
strong thumbs up from me - how much work would it be?
Who the hell knows, but it's my job to figure out.
slider has been released on cran!