Skip to contents

Gavi colors

Usage

gavi_colors(...)

Arguments

...

a list of gavi color labels

Value

a character vector with color names as labels and hex numbers as values

Examples

# Example one - use to get hex number for gavi color
gavi_colors("blue")
#>      blue 
#> "#1A3C58" 

# Example two - use with a geom call to provide color
library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
library(ggplot2)
wuenic %>%
  filter(iso3 == "AFG" & vaccine == "dtp3") %>%
  ggplot(aes(year, coverage)) +
  geom_line(color = gavi_colors("penta"))


# Example three - pair with `as_vector()` to manually set colors
wuenic %>%
  filter(iso3 == "AFG" & vaccine %in% c("dtp3", "mcv1")) %>%
  ggplot(aes(year,coverage, color = vaccine)) +
  geom_line() +
  geom_point() +
  scale_color_manual(values = as.vector(gavi_colors("penta", "mcv")))