/
AirSensor_Function_Overview.Rmd
111 lines (98 loc) · 4.63 KB
/
AirSensor_Function_Overview.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
title: "AirSensor Function Overview"
author: "Mazama Science"
date: "2020-01-04"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{AirSensor Function Overview}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
# Function Overview
This document has been updated to reflect functions in AirSensor version 0.6.x.
## Synoptic Data
Purple Air Synoptic (PAS) data provides a view of their sensor network with
location metadata and an instantaneous view of measured values. Within the
**AirSensor** package, this data is available as a `pas` object. All functions
beginning with `pas_` are designed for creating or working with this data. The
following functions are the most common end-user functions:
| function | params |
|:------|:-----|
| **Creating a `pas`** | |
| `pas_createNew()` | `countryCodes, includePWFSL, lookbackDays, baseUrl` |
| **Loading a `pas`** | |
| `pas_load()` | `datestamp, retries, timezone, archival` |
| **Obtaining information from a `pas`** | |
| `pas_getColumn()` | `pas, name, pattern, isOutside, isParent` |
| `pas_getDeviceDeploymentIDs()` | `pas, pattern, isOutside, isParent` |
| `pas_getIDs()` | `pas, pattern, isOutside, isParent` |
| `pas_getLabels()` | `pas, pattern, isOutside, isParent` |
| **Manipulating a `pas`** | |
| `pas_filter()` | `pas, ...` |
| `pas_filterArea()` | `pas, w, e, s, n` |
| `pas_filterNear()` | `pas, longitude, latitude, radius` |
| **Plotting a `pas`** | |
| `pas_leaflet()` | `pas, parameter, paletteName, ...` |
| `pas_staticMap()` | `pas, parameter, paletteName, ...` |
## Timeseries Data
PurpleAir Timeseries (PAT) data is available on a per-sensor basis. Within the
**AirSensor** package, this data is available as a `pat` object. All functions
beginning with `pat_` are designed for creating or working with this data. The
following functions are the most common end-user functions:
| function | params |
|:------|:-----|
| **Creating a `pat`** | |
| `pat_createNew()` | `id, label, pas, startdate, enddate, timezone, baseUrl` |
| **Loading a `pat`** | |
| `pat_load()` | `id, label, pas, startdate, enddate, days, timezone` |
| `pat_loadLatest()` | `id, label, pas` |
| `pat_loadMonth()` | `id, label, pas, datestamp, timezone` |
| **Manipulating a `pat`** | |
| `pat_filter()` | `pat, ...` |
| `pat_filterDate()` | `pat, startdate, enddate, ...` |
| `pat_filterDatetime()` | `pat, startdate, enddate, ...` |
| `pat_join()` | `pat, pat, ...` |
| `pat_outliers()` | `pat, windowSize, thresholdMin, replace, showPlot, ...` |
| `pat_qc()` | `pat, ...` |
| `pat_sample()` | `pat, sampleSize` |
| **Plotting a `pat`** | |
| `pat_dygraph()` | `pat, parameter, sampleSize, ...` |
| `pat_multiPlot()` | `pat, plottype, sampleSize, ...` |
| `pat_scatterPlotMatrix()` | `pat, parameters, sampleSize, ...` |
| **State-of-Health functions** | |
| `pat_dailySoH()` | `pat, Soh_functions` |
| `pat_dailySoHIndex_Plot_00()` | `pat, minPctReporting, breaks` |
| `pat_dailySoHIndexPlot()` | `pat, minPctReporting, breaks, SoHIndex_FUN` |
| `pat_dailySoHPlot()` | `pat, ncol` |
| **Other functions** | |
| `pat_aggregate()` | `pat, FUN, ...` |
| `pat_aggregateOutliserCounts()` | `pat, period, windowSize, thresholdMin` |
| `pat_externalFit()` | `pat, ...` |
| `pat_internalFit()` | `pat, ...` |
| `pat_monitorComparison()` | `pat, ...` |
## Hourly Aggregated Data
Hourly Aggregated data can be generated from `pat` objects with the
`pat_createAirSensor()` function. Within the **AirSensor** package, this data is
available as an `airsensor` object. All functions beginning with `sensor_` are
designed for obtaining or working with this data. The following functions are
the most common end-user functions:
| function | params |
|:------|:-----|
| **Creating an `airsensor`** | |
| `pat_createAirSensor()` | `pat, parameter, FUN, ...` |
| **Loading an `airsensor`** | |
| `sensor_load()` | `collection, startdate, enddate, days, timezone` |
| `sensor_loadLatest()` | `collection, days` |
| `sensor_loadMonth()` | `collection, datestamp, timezone` |
| `sensor_loadYear()` | `collection, datestamp, timezone` |
| **Manipulating an `airsensor`** | |
| `sensor_filter()` | `sensor, ...` |
| `sensor_filterMeta()` | `sensor, ...` |
| `sensor_filterDate()` | `sensor, startdate, enddate, days, ...` |
| `sensor_filterDate()` | `sensor, startdate, enddate, timezone` |
| **Plotting an `airsensor`** | |
| `sensor_polarPlot()` | `sensor, windData, statistic, ...` |
| `sensor_pollutionRose()` | `sensor, windData, statistic, ...` |
| `sensor_calendarPlot()` | `sensor, ...` |
Note that each `airsensor` object is also a `ws_monitor` object and can be
manipulated and plotted with functions from the **PWFSLSmoke** package.