-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify use of enw_retrospective_data #82
Conversation
So I looked at this a bit more and thought that maybe it would be better if Doing this gives the following workflow which personally I think is a little clearer and easier to use (much easier if allowing yourself to use some kind of pipe). # Load epinowcast and data.table
library(epinowcast)
library(data.table)
# Load and filter germany hospitalisations
nat_germany_hosp <- germany_covid19_hosp[location == "DE"][age_group %in% "00+"]
nat_germany_hosp <- nat_germany_hosp[report_date <= as.Date("2021-10-01")]
# Make a retrospective dataset
retro_nat_germany <- nat_germany_hosp |>
enw_filter_report_dates(remove_days = 40) |>
enw_filter_reference_dates(include_days = 40)
# Get latest observations for the same time period
latest_obs <- nat_germany_hosp |>
enw_latest_data() |>
enw_filter_report_dates(remove_days = 40) |>
enw_filter_reference_dates(include_days = 40) The potential downside here is the duplication for retrospective and latest data but I think that might be hard to avoid. Note: I haven't followed through fully with this idea yet (i.e tests, documentation updates, etc.) to avoid wasting work if we don't stick with this. Also yes this should probably be happening in another PR etc. etc. but sometimes we all have more ice cream than we should. |
Codecov Report
@@ Coverage Diff @@
## develop #82 +/- ##
===========================================
+ Coverage 55.92% 56.88% +0.95%
===========================================
Files 12 12
Lines 928 937 +9
===========================================
+ Hits 519 533 +14
+ Misses 409 404 -5
Continue to review full report at Codecov.
|
Aims to fix #79 with documentation and clearer argument names.