View source: R/plastic_emissions.R
plastic_emissions | R Documentation |
Computes embodied GHG emissions for plastics using uk_gov_data
rows with
Level 2 = "Plastic". Material-use factors come from
Level 1 = "Material use", Column Text = "Primary material production"
.
Waste factors come from Level 1 = "Waste disposal", Column Text = waste_disposal
.
Factors are assumed kg CO2e per tonne (UOM = tonne
, GHG/Unit = kg CO2e
).
plastic_emissions(
use = stats::setNames(numeric(), character()),
waste = TRUE,
waste_disposal = c("Landfill", "Open-loop", "Closed-loop", "Combustion"),
units = c("kg", "tonnes"),
value_col = c("value", "value_2024"),
strict = TRUE
)
use |
Named numeric vector of plastic quantities in tonnes.
Names are matched (case/space/punctuation-insensitive) to
|
waste |
Logical. If |
waste_disposal |
One of |
units |
Output units: |
value_col |
Which numeric column to use in |
strict |
If |
Material use: Plastics generally use "Primary material production"
as the Column Text
. This function always uses that for material-use factors.
Waste disposal: Factors are taken from the specified waste_disposal
route. Availability varies by plastic type and year; this is enforced by the
presence/absence of rows in uk_gov_data
. Missing pairs error under
strict = TRUE
or contribute zero under strict = FALSE
.
Units: Factors are kg CO2e per tonne; if units = "tonnes"
, the total is
divided by 1000.
Numeric total emissions in requested units
.
# 1) Basic: primary material production + landfill; waste tonnage = use
plastic_emissions(
use = c(average_plastics = 100, hdpe = 50, pet = 25), # tonnes
waste_disposal = "Landfill",
waste = TRUE,
units = "kg"
)
# 2) Choose 2024 factors and report in tonnes; no waste applied
plastic_emissions(
use = c(average_plastic_film = 10, average_plastic_rigid = 5, pp = 2),
waste_disposal = "Closed-loop",
waste = FALSE,
value_col = "value_2024",
units = "tonnes"
)
# 3) Strict behaviour: error if a required waste route is unavailable
## Not run:
plastic_emissions(
use = c(ps = 1),
waste_disposal = "Combustion",
waste = TRUE,
strict = TRUE
)
## End(Not run)
# Tolerant: treat missing waste factors as 0
plastic_emissions(
use = c(ps = 1),
waste_disposal = "Combustion",
waste = TRUE,
strict = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.