addAQILegend: Add an AQI legend to a map

View source: R/addAQILegend.R

addAQILegendR Documentation

Add an AQI legend to a map

Description

This function is a convenience wrapper around graphics::legend(). It will show the AQI colors and names by default if col and legend are not specified.

AQI categories are arranged with lower levels at the bottom of the legend to match the arrangement in the plot. This is different from the default "reading order" so you may wish to reverse the order of user supplied arguments with rev() .

Usage

addAQILegend(
  x = "topright",
  y = NULL,
  pollutant = c("PM2.5", "CO", "OZONE", "PM10", "AQI"),
  palette = c("EPA", "subdued", "deuteranopia"),
  languageCode = c("eng", "spa"),
  ...
)

Arguments

x

x Coordinate passed on to the legend() command.

y

y Coordinate passed on to the legend() command.

pollutant

EPA AQS criteria pollutant.

palette

Named color palette to use for AQI categories.

languageCode

ISO 639-2 alpha-3 language code.

...

Additional arguments to be passed to legend().

Value

A list with components rect and text is returned invisbly. (See legend.)


AirMonitor documentation built on Aug. 26, 2023, 1:08 a.m.