Summarises simulated or observed thermal energy data for each monitoring period, returning baseline thermal output, baseline emissions, project emissions, and emission reductions.

aggregate_monitoring_periods(
  thermal_data,
  monitoring_cols = c("year", "month"),
  group_cols = "facility_id",
  energy_col = "thermal_energy_mwh",
  baseline_factor_col = "baseline_emission_factor",
  project_col = "project_emissions_tco2e"
)

Arguments

thermal_data

Tibble containing monitoring observations, including the columns listed in group_cols and monitoring_cols plus thermal energy and emission information.

monitoring_cols

Character vector specifying the columns that define a monitoring period.

group_cols

Character vector specifying entity-level identifiers (e.g. facility_id).

energy_col

Name of the column with thermal energy delivered for each observation in MWhth.

baseline_factor_col

Name of the column storing the baseline emission factor.

project_col

Name of the project emissions column (aggregated as the sum across the period).

Value

Tibble aggregated by entity and monitoring period with columns for baseline thermal output, baseline emissions, project emissions, and emission reductions.

Examples

data <- simulate_ams_ic_dataset(n_facilities = 2, n_periods = 3)
aggregate_monitoring_periods(data)
#> Error: `useful_energy_col` must be present in `thermal_data`.