View source: R/connected_scatterplot.R
| plot_connected_scatter | R Documentation |
Generates a connected scatterplot of trajectories for deaths and new infections for specified countries.
plot_connected_scatter(.data, sel_cntry, year_range = 2010:2023)
.data |
A data frame containing epidemiological data. It should include columns such as |
sel_cntry |
A character vector of countries to include in the plot. |
year_range |
A numeric vector specifying the range of years to include in the analysis. Default is |
This function serves as a wrapper, orchestrating the preparation, calculation, and visualization of the data. It processes the input data, calculates appropriate axis limits, constructs the epidemic control plot, and finally adds an annotation for epidemic control.
A ggplot2 plot object showing the epidemic control trajectories with deaths on the x-axis and new infections on the y-axis.
## Not run:
df_unaids <- load_unaids(pepfar_only = FALSE)
plot_connected_scatter(df_unaids)
plot_connected_scatter(df_unaids, sel_cntry = "Lesotho")
plot_connected_scatter(df_unaids, sel_cntry = c("South Africa", "Zambia", "Kenya", "Malawi"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.