Skip to contents

This function generates a subnational mapping plot for a specified indicator, using a gradient color scheme.

Usage

# S3 method for class 'cd_mapping'
plot(
  x,
  indicator = NULL,
  denominator = c("dhis2", "anc1", "penta1"),
  palette = c("Reds", "Blues", "Greens", "Purples", "YlGnBu"),
  plot_year = NULL,
  title = NULL,
  ...
)

Arguments

x

A data frame containing the subnational mapping data.

indicator

A string specifying the indicator to visualize. Options include:

  • "anc1"

  • "bcg"

  • "measles1"

  • "measles2"

  • "measles3"

  • "opv1"

  • "opv2"

  • "opv3"

  • "pcv1"

  • "pcv2"

  • "pcv3"

  • "penta1"

  • "penta2"

  • "penta2"

  • "rota1"

  • "rota2"

  • "instdeliveries"

  • "ipv1"

  • "ipv2"

  • "undervax"

  • "zerodose"

  • "dropout_measles12"

  • "dropout_penta13"

  • "dropout_penta3mcv1"

denominator

A string specifying the denominator used in the calculation. Options are:

  • "dhis2"

  • "anc1"

  • "penta1"

palette

A string specifying the color palette. Options include:

  • "Reds"

  • "Blues"

  • "Greens"

  • "Purples"

  • "YlGnBu"

plot_year

Optional. A numeric value or vector specifying the year(s) to include in the plot. If NULL, all years in the data are included.

title

Optional. A string specifying the plot title. Defaults to "Distribution of [indicator] by Regions".

...

Other params to pass to plot

Value

A ggplot object representing the subnational mapping plot.

Examples

if (FALSE) { # \dontrun{
  # Plot Penta1 coverage with DHIS2 denominator
  plot.cd_mapping(
    x = data,
    indicator = "penta1",
    denominator = "dhis2",
    palette = "Blues",
    plot_year = 2022
  )
} # }