View source: R/resample_time.R
| resample_time | R Documentation |
Aggregates time series data to a specified period (hour, day, or month) using a chosen summary statistic. The function requires a time column.
resample_time(data, cols = NULL, date_col = NULL,
period = "hour", fun = "mean", na.rm = TRUE,
verbose = FALSE)
data |
A data frame with a time column. |
cols |
Column indices or names to aggregate. |
date_col |
Time column index or name. |
period |
Target period: |
fun |
Aggregation function: |
na.rm |
Logical; whether to remove NA values before aggregation. |
verbose |
Logical; if |
A data frame with aggregated time series.
resample_time(data[1:500, c(1, 4, 17:19)], cols = 3:5, date_col = 1, period = "hour", fun = "mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.