Description Usage Arguments Value Note See Also Examples
View source: R/monitor_asDataframe.R
Creates a dataframe with data from a ws_monitor object, essentially
flattening the object. This is especially useful when monitoring data will be shared with
non-R users working with spreadsheets. The returned dataframe will contain data from the monitor
specified with monitorID
.
The number of data columns in the returned dataframe can include all metadata as well as additional calculated values.
By default, the following, core columns are included in the dataframe:
utcTime
UTC datetime
localTime
local datetime
pm25
PM2.5 values in ug/m3
Any column from ws_monitor$meta
may be included in the vector of metaColumns
.
The following additional columns of data may be included by adding one of the following
to the vector of extraColumns{}
aqi
hourly AQI values as calculated with monitor_aqi()
nowcast
hourly Nowcast values as calcualted with monitor_nowcast()
dailyAvg
daily average PM2.5 values as calculated with monitor_dailyStatistic()
1 2 3 4 5 6 7 | monitor_asDataframe(
ws_monitor,
monitorID = NULL,
extraColumns = NULL,
metaColumns = NULL,
tlim = NULL
)
|
ws_monitor |
ws_monitor object |
monitorID |
monitor ID of interest (not needed if |
extraColumns |
optional vector of additional data columns to generate |
metaColumns |
optional vector of column names from |
tlim |
optional vector with start and end times (integer or character representing YYYYMMDD[HH] or |
A dataframe version of a ws_monitor object.
The tlim
argument is interpreted as localtime, not UTC.
1 2 3 4 5 6 7 8 9 10 | library(PWFSLSmoke)
wa <- monitor_subset(Northwest_Megafires, stateCodes='WA')
Omak_df <- monitor_asDataframe(wa, monitorID='530470013_01',
extraColumns=c('nowcast','dailyAvg'),
metaColumns=c('aqsID','siteName','timezone'),
tlim=c(20150801,20150901))
dplyr::glimpse(Omak_df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.