scale_colour_who: Adds World Health Organization-inspired colours to plots

Description Usage Arguments Author(s) See Also Examples

View source: R/scale_colour_who.R

Description

Applies WHO inspired colours for ggplot2 plots. Currently a continuous palette has not been implemented so the viridis palettes will be used as a fallback in this situation.

Usage

1
2
3
4
5
6
7
8
scale_colour_who(
  palette = "main",
  discrete = TRUE,
  reverse = FALSE,
  n = NULL,
  add_missings = FALSE,
  ...
)

Arguments

palette

A character string. the colours of choice, current options are "main", "light" and "misc" for mixed colours as well as "purple", "turquoise", "blue", "magenta", "brown", "misc", "green", and "red".

discrete

Logical, defaults to TRUE. Should the palette be discrete or continuous.

reverse

Logical, defaults to FALSE. Should the palette be reversed.

n

Number of colours desired. If a specific value is given which corresponds to the length of a palette used in the 2019 WHO TB report, this palette is returned, else the number of entries in the palette with the most colour options (up to its full length) is returned. Defaults to NULL which returns the longest palette.

add_missings

Add a grey and white colour to the palette, defaults to FALSE.

...

Pass additional arguments to ggplot2::discrete_scale or ggplot2::scale_colour_viridis_c depending on the discrete setting. @param ... Pass additional arguments to ggplot2::discrete_scale or ggplot2::scale_colour_viridis_c depending on the discrete setting.

Author(s)

Maria Bekker-Nielsen Dunbar

Sam Abbott

See Also

scale_colour_who scale_fill_who who_palettes

Examples

1
2
3
4
5
6
plot_tb_burden_summary(
  countries = "United Kingdom", compare_all_regions = FALSE,
  compare_to_region = TRUE, conf = NULL, verbose = FALSE
) +
  theme_who() +
  scale_colour_who(reverse = TRUE)

getTBinR documentation built on July 2, 2020, 12:31 a.m.