Monitoring data in AMS-II.D projects often arrive at sub-annual cadence. This helper aggregates tidy monitoring records to the project reporting periods, 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 equipment or site groupings.

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(
  unit = rep("Kiln", 3),
  month = c("Jan", "Feb", "Mar"),
  project_fuel_quantity = c(80, 75, 70),
  electricity_emissions_tco2e = c(0.5, 0.5, 0.4)
)
aggregate_monitoring_periods(
  monitoring,
  period_col = month,
  group_cols = "unit"
)
#> Error in aggregate_monitoring_periods(monitoring, period_col = month,     group_cols = "unit"): unused argument (period_col = month)