% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/events_phase_plots.R
\name{dm_event_climate_summary}
\alias{dm_event_climate_summary}
\title{Summarize event-based climate results}
\usage{
dm_event_climate_summary(
  event_data,
  climate_var,
  group_var = c("Phase", "event_type"),
  by = c("none", "month", "month_of_year", "year"),
  Year = NULL,
  DOY = NULL
)
}
\arguments{
\item{event_data}{Output of \code{dm_event_climate()}.}

\item{climate_var}{Name of the climate-derived column to summarize.}

\item{group_var}{Grouping variable. One of \code{"Phase"} or \code{"event_type"}.}

\item{by}{One of \code{"none"}, \code{"month"}, \code{"month_of_year"}, or \code{"year"}.}

\item{Year}{Optional numeric year or vector of years for filtering.}

\item{DOY}{Optional numeric vector of length 2 for filtering.}
}
\value{
A tibble of summary statistics.
}
\description{
Summarizes a climate variable extracted by \code{dm_event_climate()} by
phase, event type, month, or month-of-year.
}
\examples{
\donttest{
data(gf_nepa17)
data(ktm_clim_hourly)

zg <- phase.zg(df = gf_nepa17[1:800, ], TreeNum = 1)
evt_zg <- dm_event_climate(
  zg,
  ktm_clim_hourly,
  event = "phase_start",
  windows = c(0, 3, 6, 12, 24),
  mean_vars = c("temp", "VPD", "RH"),
  max_vars  = c("VPD"),
  sum_vars  = c("prec")
)

smry <- dm_event_climate_summary(
  evt_zg,
  climate_var = "VPD_mean_prev_6h",
  group_var = "Phase",
  by = "month_of_year"
)

head(smry)
}

}
