pas_enhanceRawData: Enhance synoptic data from PurpleAir

View source: R/pas_enhanceRawData.R

pas_enhanceRawDataR Documentation

Enhance synoptic data from PurpleAir

Description

Enhance raw synoptic data from PurpleAir to create an improved dataframe compatible with the MazamaLocationUtils package.

Steps include:

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

2) Add spatial metadata for each sensor including:

  • timezone – Olson timezone

  • countryCode – ISO 3166-1 alpha-2

  • stateCode – ISO 3166-2 alpha-2

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

4) Add additional metadata items:

  • sensorManufacturer = "Purple Air"

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

Users may also limit results by specifying stateCodes when countryCodes is limited to a single country.

When a single US state is specified, named counties may be specified to further limit the results.

Usage

pas_enhanceRawData(
  pas_raw = NULL,
  countryCodes = NULL,
  stateCodes = NULL,
  counties = NULL,
  includePWFSL = TRUE
)

Arguments

pas_raw

Dataframe returned by pas_downloadParseRawData().

countryCodes

ISO 3166-1 alpha-2 country codes used to subset the data.

stateCodes

ISO-3166-2 alpha-2 state codes used to subset the data.

counties

US county names or 5-digit FIPS codes used to subset the data.

includePWFSL

Logical specifying whether to calculate distances from PWFSL monitors.

Value

Enhanced dataframe of synoptic PurpleAir data.

References

PurpleAir

PurpleAir API

PurpleAir Terms of service

PurpleAir Data license

PurpleAir Data Attribution

See Also

pas_downloadParseRawData


MazamaScience/AirSensor documentation built on April 28, 2023, 11:16 a.m.