Calculate clinical theatre emissions row-by-row from a data frame.
Each row is expanded into a call to clinical_theatre_emissions()
using
the columns you specify. Optionally, results can be combined with
carbon price credit information and plotted.
clinical_theatre_data(
data,
time,
date_format = "%d/%m/%Y",
name,
wet_clinical_waste,
wet_clinical_waste_unit = c("tonnes", "kg"),
desflurane = 0,
sevoflurane = 0,
isoflurane = 0,
methoxyflurane = 0,
N2O = 0,
propofol = 0,
water_supply = NULL,
water_trt = TRUE,
water_unit = c("cubic metres", "million litres"),
electricity_kWh = NULL,
electricity_TD = TRUE,
electricity_WTT = TRUE,
heat_kWh = NULL,
heat_TD = TRUE,
heat_WTT = TRUE,
paper_vars = NULL,
plastic_vars = NULL,
metal_vars = NULL,
electrical_vars = NULL,
construction_vars = NULL,
paper_waste = TRUE,
plastic_waste = TRUE,
metal_waste = TRUE,
electrical_waste = TRUE,
construction_waste = TRUE,
paper_material_production = "Primary material production",
metal_material_production = "Primary material production",
construction_material_production = "Primary material production",
paper_waste_disposal = c("Closed-loop", "Combustion", "Composting", "Landfill"),
plastic_waste_disposal = c("Landfill", "Open-loop", "Closed-loop", "Combustion"),
metal_waste_disposal = c("Closed-loop", "Combustion", "Landfill", "Open-loop"),
electrical_waste_disposal = c("Landfill", "Open-loop"),
construction_waste_disposal = c("Closed-loop", "Combustion", "Composting", "Landfill",
"Open-loop"),
units = "kg",
value_col = c("value", "value_2024"),
strict = TRUE,
include_cpi = FALSE,
jurisdiction = NULL,
year = NULL,
period = 0,
manual_price = NULL,
gti_by = c("default", "month", "year"),
overall_by = c("default", "month", "year"),
single_sheet = FALSE
)
If single_sheet = NULL
: a tibble with emissions (and carbon_price_credit
if include_cpi = TRUE
).
If single_sheet = TRUE
/FALSE
: a list with the emissions table and
a plot object generated by output_display()
.
Data frame containing all variables required for emissions calculation.
Column in data
giving the time variable.
Character string of date format for time
(default: "%d/%m/%Y"
).
Column in data
giving the theatre identifier/name.
Numeric. Amount of (wet) clinical waste.
Unit for wet_clinical_waste
("tonnes"
or "kg"
).
Amount of desflurane used in KG (default: 0).
Amount of sevoflurane used in KG (default: 0).
Amount of isoflurane used in KG (default: 0).
Amount of methoxyflurane used in KG (default: 0).
Amount of nitrous oxide (N2O) used in KG (default: 0).
Amount of propofol used in KG (default: 0).
numeric, amount of water in the given unit.
logical, include treatment emissions (default TRUE).
"cubic metres" or "million litres".
numeric kWh consumed.
logical, include T&D losses (default TRUE).
logical, include WTT for electricity (default TRUE).
numeric kWh of heat/steam (onsite; excludes district).
logical, include district heat distribution losses (default TRUE).
logical, include WTT for heat/steam (default TRUE).
Named character vector mapping canonical paper keys
("board"
, "mixed"
, "paper"
) to column names in data
.
Each row’s values are passed as a paper_use
vector.
Named character vector mapping canonical plastic keys
(e.g. "average"
, "pet"
, "pp"
, "pvc"
, …) to columns in data
.
Named character vector mapping canonical metal keys
(e.g. "aluminuim_cans"
, "steel_cans"
, "scrap"
) to columns in data
.
Named character vector mapping canonical electrical keys
(e.g. "fridges"
, "freezers"
, "it"
, "alkaline_batteries"
) to columns in data
.
Named character vector mapping canonical construction keys
(e.g. "concrete"
, "bricks"
, "wood"
, "metals"
) to columns in data
.
Logical. Whether the same tonnage is assumed to go to waste treatment for
that material type (default: TRUE
).
Column text string for material-use factor (default: "Primary material production"
).
Disposal route(s) to use for each material category. See material_emissions()
for valid options.
Units of result, "kg"
or "tonnes"
. Default: "kg"
.
Which column of uk_gov_data
to use ("value"
or "value_2024"
).
Logical. If TRUE
, error when a factor is missing; if FALSE
, treat as zero.
Logical. Whether to add carbon price credit calculations.
Jurisdiction string for CPI lookup (see check_CPI()
).
CPI year and period to use.
Optional numeric CPI value to override World Bank data.
Grouping type for GTI calculation ("default"
, "month"
, "year"
).
Grouping type for overall output plot.
NULL
, TRUE
, or FALSE
. If not NULL
, returns a list
with the emissions table and a single-sheet display/plot.
df <- data.frame(
time = c("10/04/2000","11/04/2000"),
theatre = c("A","A"),
clinical_waste = c(80,90),
electricity_kwh = c(100,110),
general_waste = c(65,55)
)
clinical_theatre_data(
df,
time = time,
name = theatre,
wet_clinical_waste = clinical_waste,
wet_clinical_waste_unit = "kg",
electricity_kWh = electricity_kwh,
plastic_vars = c(average="general_waste"),
units = "kg"
)
Run the code above in your browser using DataLab