Plot National Population or Births Metrics
Source:R/plot.population_metrics.R
plot.cd_population_metrics.Rd
This function generates a plot to visualize national-level demographic data for total population or live births over time.It compares DHIS-2 and UN projections for the specified metric, limited to national-level data due to the availability of UN estimates.
Arguments
- x
A
cd_population_metrics
object containing national-level demographic data.- metric
A character string specifying the type of data to plot. It must be one of:
'population': Plots total population estimates in thousands from DHIS-2 and UN sources.
'births': Plots total live births in thousands from DHIS-2 and UN sources.
- ...
Additional arguments (not used in this function).
Details
The plot_population_metrics
function provides visualizations based on the
selected metric
:
Population Plot: Shows total population (in thousands) by year, with separate lines for DHIS-2 and UN projections.
Live Births Plot: Displays total live births (in thousands) by year, comparing DHIS-2 and UN projections.
This function supports only national-level data as UN estimates are not available at subnational levels. Attempting to plot subnational data will result in an error.