Learn R Programming

timefully (version 0.1.0)

aggregate_timeseries: Aggregate multiple timeseries columns to a single one

Description

The first column datetime will be kept.

Usage

aggregate_timeseries(dtf, varname, omit = NULL)

Value

tibble

Arguments

dtf

data.frame or tibble, first column of name datetime being of class datetime and rest of columns being numeric

varname

character, name of the aggregation column

omit

character, name of columns to not aggregate

Examples

Run this code
building_flows <- data.frame(
  datetime = as.POSIXct("2024-01-01 00:00:00", tz = "UTC") + 0:3 * 3600,
  building1 = c(2.1, 2.5, 2.3, 2.0),
  building2 = c(1.0, 1.1, 0.9, 1.2)
)
aggregate_timeseries(building_flows, varname = "total_building")

Run the code above in your browser using DataLab