| aggregate_time | R Documentation |
Aggregates data over time periods.
aggregate_time(
data,
period = c("year", "quarter", "month"),
value_col = "OBS_VALUE",
fun = mean
)
data |
Data frame with DATE column |
period |
Aggregation period: "year", "quarter", "month" |
value_col |
Column containing values to aggregate |
fun |
Aggregation function (default: mean) |
A tibble with PERIOD column and aggregated values.
data(jsa_sample)
if ("DATE" %in% names(jsa_sample)) {
yearly_data <- aggregate_time(jsa_sample, "year", "OBS_VALUE")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.