Building monitoring data are often recorded monthly or quarterly. This helper aggregates tidy monitoring records to the reporting period (typically annual).

aggregate_monitoring_periods(
  monitoring_data,
  period_col = "monitoring_period",
  group_cols = NULL,
  summarise_cols = NULL,
  output_col = "monitoring_period"
)

Arguments

monitoring_data

Tibble containing monitoring records.

period_col

Column containing the monitoring period label (e.g. month or quarter).

group_cols

Character vector of columns describing building identifiers.

summarise_cols

Optional character vector of numeric columns to sum. If NULL, all numeric columns are aggregated.

output_col

Name of the column storing the concatenated period labels.

Value

A tibble aggregated by group_cols with numeric columns summed over the monitoring period.

Examples

monitoring <- tibble::tibble(
  building_id = rep("Office_A", 3),
  month = c("Jan", "Feb", "Mar"),
  project_total_energy_mwh = c(10.5, 9.8, 9.2),
  service_level_indicator = c(0.32, 0.31, 0.33)
)
aggregate_monitoring_periods(monitoring, period_col = month, group_cols = "building_id")
#> Error in aggregate_monitoring_periods(monitoring, period_col = month,     group_cols = "building_id"): unused argument (period_col = month)