pat_downloadParseRawData {AirSensor}R Documentation

Download PurpleAir timeseries data

Description

Downloads timeseries data for a specific PurpleAir sensor from the ThingSpeak API and parses the content into individual dataframes. This function will always return dataframes with the appropriate columns even if no data are returned from ThingSpeak.

The returned list contains the following dataframes:

These dataframes contain ALL data available from ThingSpeak for the specified sensor and time period.

See the references.

Usage

pat_downloadParseRawData(
  id = NULL,
  label = NULL,
  pas = NULL,
  startdate = NULL,
  enddate = NULL,
  timezone = NULL,
  baseUrl = "https://api.thingspeak.com/channels/"
)

Arguments

id

PurpleAir sensor 'deviceDeploymentID'.

label

PurpleAir sensor 'label'.

pas

PurpleAir Synoptic pas object.

startdate

Desired start time (ISO 8601).

enddate

Desired end time (ISO 8601).

timezone

Timezone used to interpret start and end dates.

baseUrl

Base URL for Thingspeak API.

Value

List containing multiple timeseries dataframes.

References

https://www2.purpleair.com/community/faq#!hc-sd-card-csv-file-header

Examples


library(AirSensor)

setArchiveBaseUrl("http://data.mazamascience.com/PurpleAir/v1")

pas <- pas_load()

pat_rawList <- 
  pat_downloadParseRawData(
    id = "78df3c292c8448f7_21257",
    pas = pas
  )

lapply(pat_rawList, head)


[Package AirSensor version 1.0.8 Index]