temporal_aggregate | R Documentation |
The temporal processing module is used to aggregate data along the temporal
dimension. Current available aggregation recipe includes
temporal_rolling_window
.
temporal_aggregate(data, ...)
temporal_rolling_window(
var,
scale,
.before = 0L,
.step = 1L,
.complete = TRUE,
rm.na = TRUE,
...
)
data |
an index table object, see [tidyindex::init()] |
... |
an temporal processing object of class |
var |
the variable to aggregate |
scale |
numeric, the scale (window) of the aggregation |
.before, .step, .complete |
see |
rm.na |
logical, whether to remove the first few rows with NAs |
an index table object
tenterfield |>
init(time = ym) |>
temporal_aggregate(.agg = temporal_rolling_window(prcp, scale = 12))
# multiple ids (groups), and multiple scales
queensland |>
dplyr::filter(id %in% c("ASN00029038", "ASN00029127")) |>
init(id = id, time = ym) |>
temporal_aggregate(temporal_rolling_window(prcp, scale = c(12, 24)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.