Skip to contents

Computes a small set of epidemiology-friendly summaries from a subset of a weather time series.

Usage

summarise_weather_window(weather, weather_cols, statistics)

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; .conditions is reserved. No columns are inferred. Use character() 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 as c("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 example list(temp = list(avg = "mean", spread = stats::sd)). Statistic names must be unique, non-missing, and non-empty. No summaries are inferred. The optional .conditions entry is a named list of multivariable condition summaries such as count_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.