Skip to contents

[DT][echarts4r][ggplot2][gt][plotly]

A wrapper function that maps RIVM colors to specific levels/classes to use in scale_color_manual for maps or other visualizations. Note that this function is dependent on the functions ro_color() and ro_color_seq().

Usage

ro_color_seq_named(
  cat_names,
  low_col = "robijnrood",
  high_col = "robijnrood_tint15",
  NA_cat_name = "NA",
  NA_cat_col = "grijs_5"
)

Arguments

cat_names

Character. Vector that holds categories.

low_col

Character. The hexadecimal code (#RRGGBB) of the color for 'low' values. This color will be the first hex code of the sequence. Default: "robijnrood".

high_col

Character. The hexadecimal code (#RRGGBB) of the color for 'high' values. This color will be the last hex code of the sequence. Default: "robijnrood_tint15".

NA_cat_name

Character, specified 'no-record' category to search for. Default: "Geen meldingen".

NA_cat_col

Character: sets the hexadecimal code (#RRGGBB) for the 'no_record' category. Default: "grijs_5".

Examples



ro_color_seq_named(
  cat_names = c("<=99", "100 t/m 399", "400+", "Geen meldingen"),
  NA_cat_name = "Geen meldingen"
)
#>           <=99    100 t/m 399           400+ Geen meldingen 
#>      "#CA005D"      "#E7839F"      "#F7D9E7"      "#999999" 

ro_color_seq_named(
  cat_names = c("<10", "10-15", "16+", "NA"),
  low_col = "lichtblauw",
  high_col = "hemelblauw",
  NA_cat_col = "rood"
)
#>       <10     10-15       16+        NA 
#> "#8FCAE7" "#5EA1D7" "#007BC7" "#d52b1e"