Add impact diagnostics functions#17
Conversation
…ots central impact estimates, coverage and fvps. Associated documentation also added from attempts at roxygen!
| #' @export | ||
| plot_impact <- function( | ||
| data, | ||
| country = PINE, |
There was a problem hiding this comment.
I think this will fail for certain diseases. Although we use PINE as a default for a quick glace at estimates instead of running every country, there will not be some diseases in PINE countries, for example YF.
There was a problem hiding this comment.
Could we add something like, if some or any of PINE present, plot those? Likely at least one PINE country will be present in all disease datasets.
There was a problem hiding this comment.
I think a failure for a disease-country mismatch is okay, we provide PINE as a sensible default but there's no expectation that country is always present - the function will error informatively, and the user can change either data or country.
| ggplot2::geom_line(aes(colour = .data$short_name), linewidth = 0.5) + | ||
| ggplot2::geom_point(aes(colour = .data$short_name), size = 0.5) + | ||
| theme_vimc() + | ||
| facet_wrap(ggplot2::vars("country"), scales = "free_y") + |
There was a problem hiding this comment.
I think the facet_wrap should be facet_wrap(ggplot2::vars(country), scales = "free_y") to correctly facet the plots into countries
| labs( | ||
| x = x_lab, | ||
| y = glue::glue("{burden_type} averted"), | ||
| title = title |
There was a problem hiding this comment.
Add two labs to make the legend title more intuitive:
fill = "Vaccination activity", colour = "Vaccination activity"
| labs( | ||
| x = "Year", | ||
| y = ylab, | ||
| title = title |
There was a problem hiding this comment.
Same comment re tidying up legend title:
fill = "Vaccination acitivty", colour = "Vaccination activity"
| ggplot( | ||
| data, | ||
| aes( | ||
| x = .data$year, |
There was a problem hiding this comment.
Years are being plotted with 2 dp. not sure what the easiest way to deal with it is, force as.integer?
This PR replaces #15. Since this branch contains an earlier merge commit (from
develop) it cannot be rebased and will be squash-merged.PR desc copied over: