Creates a SQL-based expression for temporal aggregation of environmental
time series using DuckDB date functions. Used internally by prep_ts_env.
expr_time_env(ts_res)Expression object suitable for use in dplyr::mutate() with dbplyr
For seasonal aggregation (ts_res = "quarter"), all quarters are
normalized to year 2000 to enable cyclic plotting. Uses DuckDB's
date_trunc() and extract() functions for database-side computation.
prep_ts_env for usage context
if (FALSE) { # \dontrun{
df_env |> mutate(time = !!expr_time_env("year"))
} # }