pas_enhanceData {AirSensor}R Documentation

Enhance synoptic data from PurpleAir

Description

Enhance raw synoptic data from PurpleAir to create a generally useful dataframe.

Steps include:

1) Replace variable with more consistent, more human readable names.

2) Add spatial metadata for each sensor including:

3) Convert data types from character to POSIXct and numeric.

4) Add distance and monitorID for the two closest PWFSL monitors

5) Add additional metadata items:

Filtering by country can speed up the process of enhancement and may be performed by providing a vector ISO country codes to the countryCodes argument. By default, no subsetting is performed.

Setting outsideOnly = TRUE will return only those records marked as 'outside'.

Usage

pas_enhanceData(pas_raw = NULL, countryCodes = NULL, includePWFSL = TRUE)

Arguments

pas_raw

Dataframe returned by pas_downloadParseRawData().

countryCodes

ISO country codes used to subset the data.

includePWFSL

Logical specifying whether to calculate distances from PWFSL monitors.

Value

Enhanced Dataframe of synoptic PurpleAir data.

Note

For data obtained on July 28, 2018 this will result in removal of all 'B' channels, even those whose parent 'A' channel is marked as 'outside'. This is useful if you want a quick, synoptic view of the network, e.g. for a map.

See Also

pas_downloadParseRawData

Examples


library(AirSensor)

initializeMazamaSpatialUtils()

pas <- pas_enhanceData(example_pas_raw, 'US')

setdiff(names(pas), names(example_pas_raw))
setdiff(names(example_pas_raw), names(pas))

if ( interactive() ) {
  View(pas[1:100,])
}


[Package AirSensor version 1.0.8 Index]