Skip to contents

Calculate data set statistics for selected time intervals.

Usage

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
)

Arguments

data

(data.frame, tibble, etc) Data set containing data statistic to be calculated for, and date column of date/time records.

from

(various) Start date(s) to subsample from when calculating statistic, by default end of supplied data date range.

to

(various) End date(s) to subsample to when calculating statistic, by default end of supplied data date range.

stat

(function) Statistic to be applied to selected data, by default mean(pollutant, na.rm=TRUE).

pollutant

(character) The name(s) of data-series to analyse in data, by default all columns in supplied data except date.

...

extra arguments.

method

(numeric) Method to use when calculating statistic.

range

(character) For calcRollingDateRange, the range the rolling date windows, by default 'year' for annual statistic calculations.

res

(character) For calcRollingDateRange, the resolution to calculate the rolling statistic at, by default 'day' to calculate this once per day.

Value

These functions return data.frames of function outputs.

Note

These functions are in development and likely to change significantly in future versions, please handle with care.