reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

Add option to calculate/plot rolling averages #105

Open zkamvar opened 5 years ago

zkamvar commented 5 years ago

This comes from https://github.com/R4EPI/sitrep/issues/70#issuecomment-466289656

zkamvar commented 5 years ago

This would be related to #104 since the underlying function could be added as a ggplot2 stat.

zkamvar commented 4 years ago

When this package hits CRAN, it will be good: https://davisvaughan.github.io/slide/

aspina7 commented 4 years ago

slide function currently already on CRAN as part of the {tsibble} package (but to be deprecated in favour of {slide} mentioned by zhian)

zkamvar commented 4 years ago

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.

aspina7 commented 4 years ago

strong thumbs up from me - how much work would it be?

zkamvar commented 4 years ago

Who the hell knows, but it's my job to figure out.

aspina7 commented 4 years ago

slider has been released on cran!