pat_downloadParseRawData: Download PurpleAir timeseries data

Description Usage Arguments Value References Examples

View source: R/pat_downloadParseRawData.R

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

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

AirSensor documentation built on March 13, 2021, 1:07 a.m.