Creates a SQL-based expression for temporal aggregation of species time series
using DuckDB date functions. Used internally by prep_ts_sp.
expr_time_sp(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_sp for usage context
if (FALSE) { # \dontrun{
df_sp |> mutate(time = !!expr_time_sp("year"))
} # }