Description Usage Arguments Value Note See Also Examples
View source: R/pas_enhanceData.R
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'.
1 | pas_enhanceData(pas_raw = NULL, countryCodes = NULL, includePWFSL = TRUE)
|
pas_raw |
Dataframe returned by |
countryCodes |
ISO country codes used to subset the data. |
includePWFSL |
Logical specifying whether to calculate distances from PWFSL monitors. |
Enhanced Dataframe of synoptic PurpleAir data.
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.
pas_downloadParseRawData
1 2 3 4 5 6 7 8 9 10 11 12 | 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,])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.