Generates a connected scatterplot of trajectories for deaths and new infections for specified countries.
Arguments
- .data
A data frame containing epidemiological data. It should include columns such as
country
,year
,indicator
,estimate
, and others required for processing.- 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
2010:2023
.
Value
A ggplot2 plot object showing the epidemic control trajectories with deaths on the x-axis and new infections on the y-axis.
Details
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.
Examples
if (FALSE) { # \dontrun{
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"))
} # }