pas_palette | R Documentation |
Generates color palettes for PurpleAir synoptic data with the intention of having a reproducible functional color generator. Default palettes are available for the following parameters:
"pm2.5_~"
"humidity
"temperature
pas_palette(pas = NULL, parameter = "pm2.5_60minute", paletteName = NULL, ...)
pas |
PurpleAir Synoptic pas object. |
parameter |
Value to generate colors for, e.g. |
paletteName |
Optional name of an RColorBrewer palette, e.g.
|
... |
Additional arguments passed on to |
A list containing: 1) a label and color dataframe; and 2)
a vector of color values calculated from the data found in pas
.
library(AirSensor2)
# Smoke in Oregon
Oregon <-
example_pas_pm25 %>%
pas_filter(stateCode == "OR")
colorInfo <- pas_palette(Oregon, "pm2.5_60minute")
plot(
x = Oregon$longitude,
y = Oregon$latitude,
pch = 0,
col = colorInfo$colors
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.