Closed avallecam closed 7 months ago
I just found that epidist_db()
could also be an alternative for this issue.
library(epiparameter)
epidist_db(disease = "influenza",
epi_dist = "incubation_period",
author = "Ghani_etal")
#> Disease: Influenza
#> Pathogen: Influenza-A-H1N1Pdm
#> Epi Distribution: incubation period
#> Study: Ghani et al. (2009) <10.1371/currents.RRN1130> PMID: 20029668
#> Distribution: gamma
#> Parameters:
#> shape: 17.503123698459
#> rate: 8.5381091211995
Created on 2023-03-11 with reprex v2.0.2
A key feature is that it bypasses calling to epiparam()
. This could be a quick start option once the user already knows the database. But at a beginner phase, the user probably would prefer to explore the data.frame
before taking shortcuts. For that reason, I agree to keep the current approach of epiparam()
+ as_epidist()
.
@joshwlambert May this be an outdated issue? I currently agree with the current README display. Happy if you agree to close this at any time.
@avallecam yes, this issue is now outdated and can be closed. I will still try and implement tabs in the vignettes to offer users base R and tidyverse options for the same operations (where possible), but this can be tracked by issue #94.
Please place an "x" in all the boxes that apply
Please include a brief description of the problem with a code example:
This example in the Quick start expects to get an output for influenza
https://github.com/epiverse-trace/epiparameter/blob/ed0da13a8802e364c1e35fff97323e319838a07b/README.Rmd#L57-L60
However, since the input dataset in
epiparam()
has changed, row number 12 now gets COVID-19 as output. This is inconsistent.Created on 2023-03-11 with reprex v2.0.2
Since the data input will keep changing, and we would like to have a consistent output in time I propose to use
dplyr::filter()
since theepiparam
class object is adataframe
in the background.Created on 2023-03-11 with reprex v2.0.2
I prefer using
{dplyr}
for this as it allows to filter multiple columns in one call, it improves the human-readability of code. Additionally, it shows integration with data cleaning packages from the{tidyverse}
, which is another set of interoperable packages for this task.