aqiColors | R Documentation |
This function uses the leaflet::colorBin()
function to return a
vector or matrix of colors derived from data values.
aqiColors(
x,
pollutant = c("PM2.5", "AQI", "CO", "NO", "OZONE", "PM10", "SO2"),
palette = c("EPA", "subdued", "deuteranopia"),
na.color = NA
)
x |
Vector or matrix of PM2.5 values or an mts_monitor object. |
pollutant |
EPA AQS criteria pollutant. |
palette |
Named color palette to use for AQI categories. |
na.color |
Color assigned to missing values. |
A vector or matrix of AQI colors to be used in maps and plots.
library(AirMonitor)
# Fancy plot based on pm2.5 values
pm2.5 <- Carmel_Valley$data[,2]
Carmel_Valley %>%
monitor_timeseriesPlot(
shadedNight = TRUE,
pch = 16,
cex = pmax(pm2.5 / 100, 0.5),
col = aqiColors(pm2.5),
opacity = 0.8
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.