Convert percentiles to colors for maps, heatmap text, or barplots
Source:R/calc_ejscreen_export.R
calc_ejscreen_map_color.RdConvert percentiles to colors for maps, heatmap text, or barplots
Usage
calc_ejscreen_map_color(
x,
colorbins = ejscreen_color_defaults("ejscreen")$colorbins,
colorfills = ejscreen_color_defaults("ejscreen")$colorfills
)Value
Character vector of colors, as long as x. Missing and
out-of-range percentiles return NA_character_.
Examples
percentile <- c(-1, 0.50, 78, 80, 81, 91, 96, 100, 200)
EJAM:::calc_ejscreen_map_color(percentile)
EJAM:::pctile2color(percentile)
EJAM:::pctile2colorhex(percentile[percentile >= 0 & percentile <= 100])
EJAM:::ratio2color(c(-1, 0.5, 1, 1.06, 2, 2.5, 3, 4, 5, 200))