Learn R Programming

carbonr (version 0.2.7)

construction_emissions: Calculate construction emissions (UK govt schema)

Description

Computes embodied GHG emissions for construction materials using the UK government conversion factors table (uk_gov_data), specifically rows with Level 2 = "Construction". Factors are taken from the selected column (value or value_2024) and are assumed to be kg CO2e per tonne.

Usage

construction_emissions(
  use = stats::setNames(numeric(), character()),
  waste = TRUE,
  material_production = c("Primary material production", "Re-used", "Closed-loop source"),
  waste_disposal = c("Closed-loop", "Combustion", "Composting", "Landfill", "Open-loop"),
  units = c("kg", "tonnes"),
  value_col = c("value", "value_2024"),
  strict = TRUE
)

Value

Numeric total emissions in the requested units.

Arguments

use

Named numeric vector of material quantities in tonnes. Names are matched case/space/punctuation-insensitively to Level 3 (e.g., "Mineral oil", "mineral_oil", "MINERAL-OIL" all match). Missing/unknown materials are treated as zero.

waste

Logical. If TRUE, waste quantities are assumed equal to use (i.e., the same tonnage is sent to the chosen disposal route). If FALSE, no waste is applied (equivalent to zero for all materials).

material_production

Either:

  • a single string applied to all materials, e.g. "Primary material production", "Closed-loop source", or "Re-used"; or

  • a named character vector giving a choice per material name, e.g. c(concrete = "Closed-loop source", wood = "Re-used"). Synonyms are accepted for material production: "reused"/"re-used", "closed loop"/"closed-loop"/"closed-loop source".

waste_disposal

One of "Closed-loop", "Combustion", "Composting", "Landfill", or "Open-loop". Applied to all waste. If the chosen disposal route is not available for a material, behaviour depends on strict.

units

Output units: "kg" (default) or "tonnes".

value_col

Which factor column to use from uk_gov_data: "value" or "value_2024".

strict

Logical (default TRUE). If TRUE, error when a required factor is missing/invalid for any nonzero quantity (either material use or waste). If FALSE, treat missing factors as zero contribution.

Details

Material-production options (Column Text under Material use):

  • Aggregates, Asphalt: "Primary material production", "Closed-loop source", "Re-used".

  • Asbestos, Average Construction, Bricks: "Primary material production" only.

  • Concrete, Insulation, Metals, Mineral Oil, Plasterboard: "Primary material production" or "Closed-loop source".

  • Soils: "Closed-loop source" only.

  • Tyres, Wood: "Primary material production" or "Re-used".

Waste-disposal options (Column Text under Waste disposal):

  • "Closed-loop" is valid for aggregates, average, asphalt, concrete, insulation, metal, soils, mineral oil, plasterboard, tyres, wood.

  • "Combustion" is valid for average, mineral oil, wood.

  • "Composting" is valid for wood only.

  • "Landfill" is valid for everything except average, mineral oil, tyres.

  • "Open-loop" is valid for aggregates, average, asphalt, bricks, concrete (and any other materials where the table provides a factor).

These rules are enforced by the presence/absence of rows in uk_gov_data. If a requested material-route pair has no factor in the table, the lookup yields NA: with strict = TRUE a descriptive error is thrown; with strict = FALSE it contributes zero to the total.

Units: Factors are kg CO2e / tonne; if units = "tonnes", the result is divided by 1000.

Examples

Run this code
# 1) Basic: primary production for all materials, landfill waste = use
construction_emissions(
  use = c(Aggregates = 1000, Concrete = 500, Wood = 2000),
  material_production = "Primary material production",
  waste_disposal = "Landfill",
  waste = TRUE,
  strict = FALSE,
  units = "kg"
)

# 2) Per-material production + synonyms ("closed loop" ->
# "Closed-loop source", "reused" -> "Re-used")
construction_emissions(
  use = c(aggregates = 100, concrete = 50, wood = 10),
  material_production = c(aggregates = "closed loop",
                          concrete = "Closed-loop source",
                          wood = "reused"),
  waste_disposal = "Landfill",
  waste = TRUE,
  units = "tonnes",
  value_col = "value_2024"
)

# 3)  Tolerant mode treats missing factors as zero:
construction_emissions(
  use = c(bricks = 10),
  material_production = "Re-used",
  strict = FALSE
)

Run the code above in your browser using DataLab