
Summarise Weather Inside a Single Window
Source:R/summarise_weather_window.R
summarise_weather_window.RdComputes a small set of epidemiology-friendly summaries from a subset of a weather time series.
Arguments
- weather
A validated weather data frame.
- weather_cols
Required character vector of existing numeric weather columns. Column names must be unique, non-missing, and non-empty. If named, every entry must have a unique, non-missing, non-empty output alias;
.conditionsis reserved. No columns are inferred. Usecharacter()explicitly for condition-only summaries.- statistics
Required summary specification. Use a non-empty character vector to apply the same statistics to all
weather_cols, such asc("mean", "sd", "IQR"). Alternatively, use a named list keyed by every selected column's output alias (or column name when unnamed), with no unknown keys. Each entry must be a non-empty character vector or a nested named list of functions or single function names, for examplelist(temp = list(avg = "mean", spread = stats::sd)). Statistic names must be unique, non-missing, and non-empty. No summaries are inferred. The optional.conditionsentry is a named list of multivariable condition summaries such ascount_when(temp >= 18 & rh >= 90).
Value
A list of two one-row data frames. features contains summary metrics.
coverage contains the row count and missing percentages relative to supplied
rows. Use scan_windows() to count missing timestamps.