Convert percentiles to color names
Usage
pctile2color(
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_.
Details
Alias for calc_ejscreen_map_color(), including its historical
eleven-bin defaults. Both percentile schemes use the same four colors.
Examples
EJAM:::pctile2color(c(79, 80, 90, 95, 100, NA))
# gray, yellow, orange, red, red, NA
defaults <- EJAM:::ejscreen_color_defaults()
EJAM:::pctile2color(c(79, 80, 90, 95),
colorbins = defaults$colorbins, colorfills = defaults$colorfills)