50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

EpiNow2 (version 1.3.2)

theme_map: Custom Map Theme

Description

Applies a custom map theme to be used with global_map, country_map, and other ggplot2 maps. Status of this function is currently questioning as it is uncertain if it is in use. Future releases may depreciate it.

Usage

theme_map(
  map = NULL,
  continuous = FALSE,
  variable_label = NULL,
  trans = "identity",
  fill_labels = NULL,
  scale_fill = NULL,
  breaks = NULL,
  ...
)

Arguments

map

ggplot2 map object

continuous

Logical defaults to FALSE. Is the fill variable continuous.

variable_label

A character string indicating the variable label to use. If not supplied then the underlying variable name is used.

trans

A character string specifying the transform to use on the specified metric. Defaults to no transform ("identity"). Other options include log scaling ("log") and log base 10 scaling ("log10"). For a complete list of options see ggplot2::continous_scale.

fill_labels

A function to use to allocate legend labels. An example (used below) is scales::percent, which can be used for percentage data.

scale_fill

Function to use for scaling the fill. Defaults to a custom ggplot2::scale_fill_manual, which expects the possible values to be "Increasing", "Likely increasing", "Likely decreasing", "Decreasing" or "Unsure".

breaks

Breaks to use in legend. Defaults to ggplot2::waiver.

...

Additional arguments passed to the scale_fill function

Value

A ggplot2 object