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.
pas_enhanceRawData(
pas_raw = NULL,
countryCodes = NULL,
stateCodes = NULL,
counties = NULL,
includePWFSL = TRUE
)
Dataframe returned by pas_downloadParseRawData()
.
ISO 3166-1 alpha-2 country codes used to subset the data.
ISO-3166-2 alpha-2 state codes used to subset the data.
US county names or 5-digit FIPS codes used to subset the data.
Logical specifying whether to calculate distances from PWFSL monitors.
Enhanced dataframe of synoptic PurpleAir data.