Skip to contents

Applies scan_windows to many site-specific reference dates and returns a wide table with one row per reference event and one column per metric-window combination. The reference date can be an assessment date, planting date, or any other timestamp stored in the input table.

Usage

window_pane(
  weather,
  assessments,
  windows,
  reference_col = NULL,
  id_col = NULL,
  response_col = NULL,
  weather_cols = NULL,
  time_col = "time",
  temp_col = "temp",
  rh_col = "rh",
  rain_col = "rain",
  leaf_wetness_col = "leaf_wetness",
  unit = c("days", "hours"),
  statistics = list(
    temp = c("mean", "min", "max"),
    rh = "mean",
    rain = "sum",
    leaf_wetness = "sum"
  )
)

Arguments

weather

A weather data frame.

assessments

A data frame containing reference times and optional IDs or responses.

windows

A data frame created by make_windows.

reference_col

Name of the reference timestamp column. If NULL, the function uses metadata stored by make_windows or falls back to "assessment_time".

id_col

Optional site, location, or assessment identifier column. When this column is present in both weather and assessments, each row is matched to the weather series from the same ID.

response_col

Optional response column, such as disease intensity.

weather_cols

Character vector of weather columns to summarize. If named, the names are used in the output feature names.

time_col

Name of the weather timestamp column.

temp_col

Name of the temperature column.

rh_col

Name of the relative humidity column.

rain_col

Name of the rainfall column.

leaf_wetness_col

Name of the leaf wetness column.

unit

Time unit for relative-time windows. One of "days" or "hours".

statistics

Summary statistics passed to summarise_weather_window().

Value

A wide data frame with one row per reference event.