Learn R Programming

AirSensor (version 1.0.8)

pas_upgrade: Upgrade pa_synoptic object format

Description

The pas is checked for the latest pa_synoptic format and presence of core metadata columns:

  • ID -- Purple Air ID

  • label -- location label

  • DEVICE_LOCATIONTYPE -- location descriptor

  • THINGSPEAK_PRIMARY_ID -- Thingspeak API access ID

  • THINGSPEAK_PRIMARY_ID_READ_KEY -- Thingspeak API access key

  • THINGSPEAK_SECONDARY_ID -- Thingspeak API access ID

  • THINGSPEAK_SECONDARY_ID_READ_KEY -- Thingspeak API access key

  • longitude -- decimal degrees E

  • latitude -- decimal degrees N

  • pm25 -- latest PM25

  • lasteSeenDate -- last update datetime

  • sensorType -- PurpleAir sensor type

  • flag_hidden -- hidden flag

  • isOwner -- owner logical

  • humidity -- %

  • temperature -- deg F

  • pressure -- mb

  • age -- sensor age

  • parentID -- device parent ID

  • timezone -- Olson timezone

  • flag_highValue -- out of spec flag

  • flag_attenutation_hardware -- hardware failure flag

  • Ozone1 -- latest ozone data

  • pm25_current -- current PM2.5 data

  • pm25_10min -- 10-minute average PM2.5 data

  • pm25_30min -- 30-minute average PM2.5 data

  • pm25_1hr -- 1-hour average PM2.5 data

  • pm25_6hr -- 6-hour average PM2.5 data

  • pm25_1day -- 1-day PM2.5 average data

  • pm25_1week -- 1-week PM2.5 average data

  • statsLastModifiedDate -- last modified date

  • statsLastModifiedInterval -- interval between modified date

  • deviceID -- unique device identifier

  • locationID -- generated location ID

  • deviveDeploymentID -- generated unique ID

  • countryCode -- ISO 3166-1 alpha-2

  • stateCode -- ISO 3166-2 alpha-2

  • timezone -- location timezone

  • airDistrict -- Air district, if any

  • pwfsl_closestDistance -- nearest regulatory monitor distance, meters

  • pwfsl_closestMonitorID -- nearest regularoty monitor ID

  • sensorManufacturer -- hardware manufacturer

  • targetPollutant -- target pollutant data

  • technologyType -- type of sensor technology

  • communityRegion -- defined regional community.

Usage

pas_upgrade(pas = NULL, verbose = TRUE)

Arguments

pas

A pa_synoptic object.

verbose

(logical) Display upgrade messages.

Value

TRUE if pas has the correct structure, FALSE otherwise.

Examples

Run this code
# NOT RUN {
library(AirSensor)

# Initialize the required spatial utilities
initializeMazamaSpatialUtils()

# Use outdated pa_synoptic database
setArchiveBaseUrl('http://data.mazamascience.com/PurpleAir/v1')

pas <- 
  pas_load() %>%
  pas_upgrade()
# }

Run the code above in your browser using DataLab