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:
timezone -- olson timezone
countryCode -- ISO 3166-1 alpha-2
stateCode -- ISO 3166-2 alpha-2
airDistrict -- CARB air districts
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:
sensorManufacturer = "Purple Air"
targetPollutant = "PM"
technologyType = "consumer-grade"
communityRegion -- (where known)
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'.