View source: R/clinical_theatre_data.R
clinical_theatre_data | R Documentation |
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
)
data |
Data frame containing all variables required for emissions calculation. |
time |
Column in |
date_format |
Character string of date format for |
name |
Column in |
wet_clinical_waste |
Numeric. Amount of (wet) clinical waste. |
wet_clinical_waste_unit |
Unit for |
desflurane |
Amount of desflurane used in KG (default: 0). |
sevoflurane |
Amount of sevoflurane used in KG (default: 0). |
isoflurane |
Amount of isoflurane used in KG (default: 0). |
methoxyflurane |
Amount of methoxyflurane used in KG (default: 0). |
N2O |
Amount of nitrous oxide (N2O) used in KG (default: 0). |
propofol |
Amount of propofol used in KG (default: 0). |
water_supply |
numeric, amount of water in the given unit. |
water_trt |
logical, include treatment emissions (default TRUE). |
water_unit |
"cubic metres" or "million litres". |
electricity_kWh |
numeric kWh consumed. |
electricity_TD |
logical, include T&D losses (default TRUE). |
electricity_WTT |
logical, include WTT for electricity (default TRUE). |
heat_kWh |
numeric kWh of heat/steam (onsite; excludes district). |
heat_TD |
logical, include district heat distribution losses (default TRUE). |
heat_WTT |
logical, include WTT for heat/steam (default TRUE). |
paper_vars |
Named character vector mapping canonical paper keys
( |
plastic_vars |
Named character vector mapping canonical plastic keys
(e.g. |
metal_vars |
Named character vector mapping canonical metal keys
(e.g. |
electrical_vars |
Named character vector mapping canonical electrical keys
(e.g. |
construction_vars |
Named character vector mapping canonical construction keys
(e.g. |
paper_waste , plastic_waste , metal_waste , electrical_waste , construction_waste |
Logical. Whether the same tonnage is assumed to go to waste treatment for
that material type (default: |
paper_material_production , metal_material_production , construction_material_production |
Column text string for material-use factor (default: |
paper_waste_disposal , plastic_waste_disposal , metal_waste_disposal , electrical_waste_disposal , construction_waste_disposal |
Disposal route(s) to use for each material category. See |
units |
Units of result, |
value_col |
Which column of |
strict |
Logical. If |
include_cpi |
Logical. Whether to add carbon price credit calculations. |
jurisdiction |
Jurisdiction string for CPI lookup (see |
year , period |
CPI year and period to use. |
manual_price |
Optional numeric CPI value to override World Bank data. |
gti_by |
Grouping type for GTI calculation ( |
overall_by |
Grouping type for overall output plot. |
single_sheet |
|
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()
.
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.