pat_createPATimeseriesObject {AirSensor}R Documentation

Combine PurpleAir raw dataframes


The pat_downloadParseRawData() function returns four dataframes of data from ThingSpeak. These must be combined into the single data dataframe found in a 'pat' object. This process involves selecting data columns to use and bringing all data onto a unified time axis.

Two sets of data values exist in the raw data, one for each of two algorithms that convert particle counts into aerosol density.

PurpleAir has the following description:

The CF_ATM and CF_1 values are calculated from the particle count data with a proprietary algorithm developed by the PMS5003 laser counter manufacturer, PlanTower. The specifics of the calculation are not available to the public (or us for that matter). However, to convert the particle count data (um/dl) to a mass concentration (ug/m3) they must use an average particle density. They do provide 2 different mass concentration conversion options; CF_1 uses the "average particle density" for indoor particulate matter and CF_ATM uses the "average particle density" for outdoor particulate matter.

The AirSensor package and all associated archive data use PlanTower algorithm CF_ATM.


pat_createPATimeseriesObject(pat_rawList = NULL)



List of dataframes as returned by pat_downloadParseRawData().


A PurpleAir Timeseries pat object.





pas <- pas_load()

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

pat <- pat_createPATimeseriesObject(pat_rawList)


[Package AirSensor version 1.0.8 Index]