powered by
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)
A data frame with aggregated time series.
A data frame with a time column.
Column indices or names to aggregate.
Time column index or name.
Target period: "hour", "day", or "month".
"hour"
"day"
"month"
Aggregation function: "mean", "sum", "min", "max", "median", or "sd".
"mean"
"sum"
"min"
"max"
"median"
"sd"
Logical; whether to remove NA values before aggregation.
Logical; if TRUE, prints progress message.
TRUE
resample_time(data[1:500, c(1, 4, 17:19)], cols = 3:5, date_col = 1, period = "hour", fun = "mean")
Run the code above in your browser using DataLab