Learn R Programming

AirSensor (version 1.0.2)

pat_createNew: Load latest PurpleAir time series data

Description

Retrieve and parse timeseries data from the Thingspeak API for specific PurpleAir sensors.

Dates can be anything that is understood by MazamaCoreUtils::parseDatetime() including any of the following recommended formats:

  • "YYYYmmdd"

  • "YYYY-mm-dd"

  • "YYYY-mm-dd HH:MM:SS"

Usage

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

Arguments

id

PurpleAir sensor 'deviceDeploymentID'.

label

PurpleAir sensor 'label'.

pas

PurpleAir Synoptic pas object.

startdate

Desired UTC start time (ISO 8601) or POSIXct.

enddate

Desired UTC end time (ISO 8601) or POSIXct.

timezone

Timezone used to interpret start and end dates.

baseUrl

Base URL for Thingspeak API.

verbose

Logical controlling the generation of warning and error messages.

Value

A PurpleAir Timeseries pat object.

See Also

pat_downloadParseRawData

Examples

Run this code
# NOT RUN {
library(AirSensor)

pat <- pat_createNew(
  label = "Seattle", 
  pas = example_pas, 
  startdate = 20180701, 
  enddate = 20180901
)
pat_multiPlot(pat)
# }

Run the code above in your browser using DataLab