Calculate data set statistics for selected time intervals.
calcDateRangeStat(
data,
from = NULL,
to = NULL,
stat = NULL,
pollutant = NULL,
...,
method = 2
)calcRollingDateRangeStat(
data,
range = "year",
res = "day",
stat = NULL,
pollutant = NULL,
from = NULL,
to = NULL,
...,
method = 2
)
These functions return data.frames of function
outputs.
(data.frame, tibble, etc) Data set containing
data statistic to be calculated for, and date
column of date/time records.
(various) Start date(s) to subsample from when
calculating statistic, by default end of supplied
data date range.
(various) End date(s) to subsample to when
calculating statistic, by default end of supplied
data date range.
(function) Statistic to be applied to selected
data, by default mean(pollutant, na.rm=TRUE). NB:
This should be a function that works on vectors in the form
function(x).
(character) The name(s) of data-series to
analyse in data, by default all columns in
supplied data except date.
extra arguments.
(numeric) Method to use when calculating statistic. Currently 1 (using base R), 2 (using dplyr), 3 (using data.table), and 4 (using dplyr and purrr)
(character) For calcRollingDateRange,
the range the rolling date windows, by default
'year' for annual statistic calculations.
(character) For calcRollingDateRange,
the resolution to calculate the rolling statistic at, by
default 'day' to calculate this once per day.