Learn R Programming

carbonr (version 0.2.7)

paper_emissions: Paper emissions

Description

Computes embodied GHG emissions for paper using uk_gov_data rows with Level 2 = "Paper". Material-use factors come from Level 1 = "Material use", Column Text = material_production. Waste factors come from Level 1 = "Waste disposal", Column Text = waste_disposal. Factors are kg CO2e per tonne.

Usage

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

Value

Numeric total emissions in requested units.

Arguments

use

Named numeric vector of paper quantities in tonnes. Names matched case/space/punctuation-insensitively to Level 3 (drops a leading "Paper: " prefix and trailing parentheses). Canonical names: board, mixed, paper. Unknown names warn and are ignored.

waste

Logical. If TRUE, waste tonnages are the same as use. If FALSE, no waste is applied.

material_production

Either a single string applied to all paper types (e.g., "Primary material production" or "Closed-loop source"), or a named vector per paper type, e.g. c(board = "Closed-loop source", mixed = "Primary material production"). If you provide a per-material vector for a subset, unspecified types default to "Primary material production".

waste_disposal

One of "Closed-loop", "Combustion", "Composting", "Landfill".

units

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

value_col

Which numeric column in uk_gov_data to use: "value" or "value_2024".

strict

If TRUE (default), error when any nonzero use/waste needs a factor that is absent in the table. If FALSE, treat missing factors as 0.

Examples

Run this code
# Closed-loop source for all paper types; landfill; waste = use
paper_emissions(
  use = c(board = 10, paper = 100),
  material_production = "Closed-loop source",
  waste_disposal = "Landfill",
  waste = TRUE
)

# Per-material: board closed-loop, mixed primary (default), no waste
paper_emissions(
  use = c(board = 5, mixed = 2),
  material_production = c(board = "closed loop"),
  waste = FALSE,
  value_col = "value_2024",
  units = "tonnes"
)

Run the code above in your browser using DataLab