View source: R/events_phase_plots.R
| dm_event_climate | R Documentation |
Extracts climate at event times and summarizes climate in windows preceding
those events. Event times can be phase starts, phase ends, or
Max.twd.time for phase.zg() output.
dm_event_climate(
x,
clim_df,
event = c("phase_start", "phase_end", "max_twd"),
phase = "all",
windows = c(0, 1, 3, 6, 12, 24, 48),
mean_vars = NULL,
max_vars = NULL,
min_vars = NULL,
sum_vars = NULL,
median_vars = NULL,
instant_vars = NULL,
instant_match = c("nearest", "previous", "next")
)
x |
Output of |
clim_df |
Subdaily climate input. This can be a standardized climate
object from |
event |
One of |
phase |
Phase selector. For |
windows |
Numeric vector of antecedent windows in hours, e.g.
|
mean_vars, max_vars, min_vars, sum_vars, median_vars |
Climate variables to summarize in antecedent windows. |
instant_vars |
Climate variables to extract at the exact event time.
If |
instant_match |
Matching rule for event-time extraction:
|
A tibble with one row per event and climate summaries in the requested antecedent windows.
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",
phase = "all",
windows = c(0, 1, 3, 6, 12, 24),
mean_vars = c("temp", "VPD", "RH"),
max_vars = c("temp", "VPD"),
sum_vars = c("prec")
)
head(evt_zg)
evt_maxtwd <- dm_event_climate(
zg,
ktm_clim_hourly,
event = "max_twd",
windows = c(0, 1, 3, 6, 12, 24),
mean_vars = c("temp", "VPD", "RH"),
max_vars = c("VPD"),
sum_vars = c("prec")
)
head(evt_maxtwd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.