| dm_epoch_extract | R Documentation |
Builds a long-format epoch table by extracting climate values before and after event times.
The optional Year and DOY arguments allow the user to restrict
which events are included in the superposed epoch analysis. The full climate
table is retained for lag extraction so that values before and after selected
events are still available.
dm_epoch_extract(
events,
clim,
vars = "all",
lag_before = 24,
lag_after = 24,
step = 1,
unit = c("hours", "days", "mins"),
agg_fun = "mean",
var_funs = NULL,
Year = NULL,
DOY = NULL,
restrict_null_to_window = TRUE
)
events |
Output of [dm_event_times()] or a data frame containing an
|
clim |
Climate data frame. The first column must contain timestamps. |
vars |
Climate variables to use, or |
lag_before |
Number of lag steps before the event. |
lag_after |
Number of lag steps after the event. |
step |
Step size in units. |
unit |
One of |
agg_fun |
Aggregation function applied to all climate variables when
|
var_funs |
Optional named vector or named list of aggregation functions for each variable. |
Year |
Optional numeric vector of calendar years to include in the SEA.
Events whose |
DOY |
Optional numeric vector of length one or two giving the
day-of-year window to include in the SEA. If length one, only that DOY is
retained. If length two, the inclusive range is retained. Cross-year DOY
windows are supported, for example |
restrict_null_to_window |
Logical. If |
An object of class c("dm_epoch", "dm_epoch_extract").
# events <- dm_event_times(zg, event = "GRO_start")
# ep <- dm_epoch_extract(
# events = events,
# clim = climate,
# vars = c("Rain", "temp", "vpd"),
# Year = c(2022, 2023, 2024),
# DOY = c(100, 300),
# lag_before = 24,
# lag_after = 24,
# unit = "hours"
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.