pas_staticMap {AirSensor}R Documentation

Static map of PurpleAir sensors

Description

Creates a static map of a pas object

Users can create a map using any numeric data column within the pas object:

"pm25" "temperature" "humidity" "pressure" "pm25_current" "pm25_10min" "pm25_30min" "pm25_1hr" "pm25_6hr" "pm25_1day" "pm25_1week" "pwfsl_closestDistance"

Available paletteName options include an "AQI" color palette, as well as a suite of sequential and diverging palettes from the RColorBrewer R package.

The sequential palette names are

"Blues" "BuGn" "BuPu" "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" "YlGn" "YlGnBu" "YlOrBr" "YlOrRd"

The diverging palette names are

"BrBG" "PiYG" "PRGn" "PuOr" "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral"

Additional map tile info found at: http://maps.stamen.com/

Usage

pas_staticMap(
  pas = NULL,
  parameter = "pm25_1hr",
  paletteName = "Purples",
  mapTheme = "terrain",
  mapShape = "sq",
  direction = 1,
  minScale = 0,
  maxScale = 150,
  shape = 15,
  size = 2,
  alpha = 0.8,
  bbuff = 0.5,
  zoomAdjust = 0,
  ...
)

Arguments

pas

PurpleAir Synoptic pas object.

parameter

Value to plot, e.g. pm25_1hr.

paletteName

Base color or palette name to be used.

mapTheme

Default is "terrain", see description for additional options.

mapShape

Default is "square", can also be "natural".

direction

Legend color direction.

minScale

Minimum value to set scale for color gradient. Default is 0.

maxScale

Maximum value to set scale for color gradient. Default is 150.

shape

Symbol to use for points.

size

Size of points.

alpha

Opacity of points.

bbuff

Bounding box buffer. Default is 0.1.

zoomAdjust

Adjustment to map zoom level (-1:3).

...

Additional options: the legend can disabled guide = FALSE, and renamed with name= "Example name".

Value

A ggplot object.

Examples

library(AirSensor)

LA_basin <- 
  example_pas %>% 
  pas_filterArea(-118.5, -117.5, 33.5, 34.5)
pas_staticMap(LA_basin, paletteName = "AQI", zoomAdjust = 1)

[Package AirSensor version 1.0.8 Index]