View source: R/summary_periodic.R
summary_periodic | R Documentation |
rOstluft::format_rolf()
dataset over periodic (diurnal, weekday, etc) factors
implicitly created by cut_timeseries_periodic()
using various stat functions.Input data should be rOstluft::format_rolf()
data.
summary_periodic(
data,
y = "value",
groupings = grp("starttime_of_day"),
fun = list("mean", "sd", "median", "mad", "percentile05", "percentile25",
"percentile75", "percentile95"),
fun.args = list(na.rm = TRUE),
nmin = 3,
coords = c(lat = 47.36667, lon = 8.55)
)
data |
a data.frame or tibble containing the data |
y |
a character string specifying the taget variable to be summarised, usually "value". |
groupings |
additional groupings. Use helper |
fun |
function or list of functions for summary, can be named (then the outut stat is named after the function's name);
Strings matching the regular expression |
fun.args |
a list of extra arguments passed on to fun. |
nmin |
numeric, minimum number of values for fun, if n < nmin: NA is returned |
coords |
a named vector of the location in WGS84 coordinates for the daylight factoring.
|
a tibble with summarised data
as determined by cut_timeseries_periodic()
in combination with grouping
The names of the columns stay the same as in data
.
factor columns according to the groups specified in grouping
factor column stat
containing the name of the summarize function as level
column value
with the result of the summarize function
n
count of occurrences for the corresponding bin
freq
frequency of the corresponding bin
fn <- rOstluft.data::f("Zch_Stampfenbachstrasse_2010-2014.csv")
data <-
rOstluft::read_airmo_csv(fn) %>%
rOstluft::pluck_parameter("NOx", "O3", "PM10") %>%
rOstluft::resample(new_interval = "h1")
fun <- list(middle = "mean", middle2 = "median", ymin = "percentile05",
lower = "percentile25", upper = "percentile75", ymax = "percentile95")
data_summarized <- summary_periodic(data, fun = fun)
data_summarized
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.