
Last chance! 50% off unlimited learning
Sale ends in
openColours(scheme = "default", n = 100)
RColorBrewer
package. This
packRColorBrewer
schemes for the option
scheme
.
To colour-code categorical-type problems e.g. colours for different
pollutants, "hue" and "brewer1" are useful.
When publishing in black and white, "greyscale" is often convenient. With
most openair functions, as well as generating a greyscale colour gradient,
it also resets strip background and other coloured text and lines to
greyscale values.
Failing that, the user can define their own schemes based on R colour
names. To see the full list of names, type colors()
into R.# to return 5 colours from the "jet" scheme:
cols <- openColours("jet", 5)
cols
# to interpolate between named colours e.g. 10 colours from yellow to
# green to red:
cols <- openColours(c("yellow", "green", "red"), 10)
cols
Run the code above in your browser using DataLab