Summarises simulated or observed generation data for each monitoring period, returning baseline generation, emissions, and emission reductions. The helper leverages the equation-level functions to maintain consistency with AMS-I.A calculations.

aggregate_monitoring_periods(
  generation_data,
  monitoring_cols = c("year", "month"),
  group_cols = "user_id",
  generation_col = "generation_kwh",
  grid_factor_col = "grid_emission_factor",
  project_col = "project_emissions_tco2e"
)

Arguments

generation_data

Tibble containing monitoring observations, including the columns listed in group_cols and monitoring_cols plus generation and emission details.

monitoring_cols

Character vector specifying the columns that define a monitoring period.

group_cols

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

generation_col

Name of the column with electricity generation for each observation in kWh.

grid_factor_col

Name of the column storing the grid emission factor.

project_col

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

Value

A tibble aggregated by entity and monitoring period with columns for baseline generation, baseline emissions, project emissions, and emission reductions.

Examples

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