Learn R Programming

carbonr (version 0.2.1)

clinical_theatre_data: Clinical Emissions: Data Frame and Plot

Description

Get the clinical theatre emissions after a data frame is inputted into the function.

Usage

clinical_theatre_data(
  data,
  time,
  date_format = c("%d/%m/%Y"),
  name,
  wet_clinical_waste = 0,
  wet_clinical_waste_unit = c("tonnes", "kg"),
  desflurane = 0,
  sevoflurane = 0,
  isoflurane = 0,
  methoxyflurane = 0,
  N2O = 0,
  propofol = 0,
  water_supply = 0,
  water_trt = TRUE,
  water_unit = c("cubic metres", "million litres"),
  electricity_kWh = 0,
  electricity_TD = TRUE,
  electricity_WTT = TRUE,
  heat_kWh = 0,
  heat_TD = TRUE,
  heat_WTT = TRUE,
  glass = 0,
  board = 0,
  mixed = 0,
  paper = 0,
  average = 0,
  average_film = 0,
  average_rigid = 0,
  HDPE = 0,
  LDPE = 0,
  LLDPE = 0,
  PET = 0,
  PP = 0,
  PS = 0,
  PVC = 0,
  glass_WD = 0,
  glass_waste_disposal = c("Closed-loop", "Combustion", "Landfill", "Open-loop"),
  board_WD = 0,
  mixed_WD = 0,
  paper_WD = 0,
  paper_waste_disposal = c("Closed-loop", "Combustion", "Composting", "Landfill"),
  average_WD = 0,
  average_film_WD = 0,
  average_rigid_WD = 0,
  HDPE_WD = 0,
  LDPE_WD = 0,
  LLDPE_WD = 0,
  PET_WD = 0,
  PP_WD = 0,
  PS_WD = 0,
  PVC_WD = 0,
  plastic_waste_disposal = c("Closed-loop", "Combustion", "Landfill", "Open-loop"),
  fridges = 0,
  freezers = 0,
  electric_waste_disposal = c("Landfill", "Open-loop"),
  glass_units = c("kg", "tonnes"),
  paper_units = c("kg", "tonnes"),
  plastic_units = c("kg", "tonnes"),
  electrical_units = c("kg", "tonnes"),
  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
)

Value

Returns list containing two objects. A table containing CO2e emissions for each row of data (and carbon price index in USD if include_cpi is TRUE), and a ggplot2 object plotting the CO2e emissions. The second object is a single sheet containing summaries if single_sheet = TRUE.

Arguments

data

Data frame containing all data to be used in the emissions calculation

time

Variable in data that corresponds to the time.

date_format

The date format for the time variable (optional, default: c("%d/%m/%Y")).

name

Variable in data that corresponds to the theatre name.

wet_clinical_waste

Amount of (wet) clinical waste that is usually incinerated.

wet_clinical_waste_unit

Unit for wet_clinical_waste variable. Options are "tonnes" or "kg".

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

Amount of water used in the building.

water_trt

logical. Default TRUE. Whether to include emissions associated with water treatment for used water.

water_unit

Unit for water_supply variable. Options are "cubic metres" or "million litres".

electricity_kWh

Electricity used in kWh.

electricity_TD

logical. Default TRUE. Whether to include emissions associated with grid losses.

electricity_WTT

logical. Default TRUE. Whether to include emissions associated with extracting, refining, and transporting fuels.

heat_kWh

heat and steam used in kWh.

heat_TD

logical. Default TRUE. Whether to include emissions associated with grid losses.

heat_WTT

logical. Default TRUE. Whether to include emissions associated with extracting, refining, and transporting fuels.

glass

Numeric value representing the amount of glass. Default is 0.

board

Numeric value indicating the weight of paperboard. Default is 0.

mixed

Numeric value indicating the weight of mixed paper. Default is 0.

paper

Numeric value indicating the weight of paper. Default is 0.

average

Numeric value indicating the weight of average plastic. Default is 0.

average_film

Numeric value indicating the weight of average film plastic. Default is 0.

average_rigid

Numeric value indicating the weight of average rigid plastic. Default is 0.

HDPE

Numeric value indicating the weight of HDPE plastic. Default is 0.

LDPE

Numeric value indicating the weight of LDPE plastic. Default is 0.

LLDPE

Numeric value indicating the weight of LLDPE plastic. Default is 0.

PET

Numeric value indicating the weight of PET plastic. Default is 0.

PP

Numeric value indicating the weight of PP plastic. Default is 0.

PS

Numeric value indicating the weight of PS plastic. Default is 0.

PVC

Numeric value indicating the weight of PVC plastic. Default is 0.

glass_WD

Numeric value representing the amount of glass waste with disposal. Default is 0.

glass_waste_disposal

Character vector specifying the waste disposal method to use for metal for calculating emissions. Possible values: "Closed-loop", "Combustion", "Landfill", "Open-loop". Default is "Closed-loop". See details for more information.

board_WD

Numeric value indicating the weight of paperboard disposed of using waste disposal methods. Default is 0.

mixed_WD

Numeric value indicating the weight of mixed paper disposed of using waste disposal methods. Default is 0.

paper_WD

Numeric value indicating the weight of paper disposed of using waste disposal methods. Default is 0.

paper_waste_disposal

Character vector specifying the waste disposal method for paper to use for calculating emissions. Possible values: "Closed-loop", "Combustion", "Composting", "Landfill". Default is "Closed-loop". See details for more information.

average_WD

Numeric value indicating the weight of average plastic disposed of using waste disposal methods. Default is 0.

average_film_WD

Numeric value indicating the weight of average film plastic disposed of using waste disposal methods. Default is 0.

average_rigid_WD

Numeric value indicating the weight of average rigid plastic disposed of using waste disposal methods. Default is 0.

HDPE_WD

Numeric value indicating the weight of HDPE plastic disposed of using waste disposal methods. Default is 0.

LDPE_WD

Numeric value indicating the weight of LDPE plastic disposed of using waste disposal methods. Default is 0.

LLDPE_WD

Numeric value indicating the weight of LLDPE plastic disposed of using waste disposal methods. Default is 0.

PET_WD

Numeric value indicating the weight of PET plastic disposed of using waste disposal methods. Default is 0.

PP_WD

Numeric value indicating the weight of PP plastic disposed of using waste disposal methods. Default is 0.

PS_WD

Numeric value indicating the weight of PS plastic disposed of using waste disposal methods. Default is 0.

PVC_WD

Numeric value indicating the weight of PVC plastic disposed of using waste disposal methods. Default is 0.

plastic_waste_disposal

Character vector specifying the waste disposal method for plastic to use for calculating emissions. Possible values: "Closed-loop", "Combustion", "Landfill", "Open-loop". Default is "Closed-loop". See details for more information.

fridges

Numeric value indicating the weight of fridges. Default is 0.

freezers

Numeric value indicating the weight of freezers. Default is 0.

electric_waste_disposal

Character vector specifying the waste disposal method for electrical items to use for calculating emissions. Possible values: "Landfill", "Open-loop". Default is "Landfill". See details for more information.

glass_units

Character vector specifying the units of the emissions related to glass. Possible values: "kg", "tonnes". Default is "kg".

paper_units

Character vector specifying the units of the emissions related to paper. Possible values: "kg", "tonnes". Default is "kg".

plastic_units

Character vector specifying the units of the emissions related to plastic materials. Possible values: "kg", "tonnes". Default is "kg".

electrical_units

Character vector specifying the units of the emissions related to electrical materials. Possible values: "kg", "tonnes". Default is "kg".

include_cpi

Logical variable specifying whether to calculate carbon price credit as well as emissions.

jurisdiction

A character string specifying the jurisdiction for which the carbon price credit should be calculated. Available jurisdictions can be found by check_CPI().

year

An optional numeric value specifying the year for which the carbon price credit should be calculated. If NULL, the most recent year available in the CPI data will be used.

period

An optional numeric value specifying the period within the specified year for which the carbon price credit should be calculated. If 1, the function will use the first period if it is available; if 2, the function will use the second period if it is available. If 0, the function will calculate the mean between the first and second period.

manual_price

An option to manually input a carbon price index to override the value in the World Bank Data.

gti_by

The grouping type for calculating the GTI ("default", "month", "year").

overall_by

The grouping type for the total output plot ("default", "month", "year"). This is a plot of the emissions if include_cpi = FALSE, otherwise is the CPI value.

single_sheet

Options are NULL, TRUE or FALSE. This is whether to give the summaries in a single sheet display, or as a list containing the table and ggplot2 objects. If NULL then no graphical output is given.

Examples

Run this code
# \donttest{
# Example with dummy data
df <- data.frame(time = c("10/04/2000", "10/04/2000", "11/04/2000",
                          "11/04/2000", "12/04/2000", "12/04/2000"),
                 theatre = rep(c("A", "B"), times = 3),
                 clinical_waste = c(80, 90, 80, 100, 120, 110),
                 electricity_kwh = c(100, 110, 90, 100, 100, 110),
                 general_waste = c(65, 55, 70, 50, 60, 30))

clinical_theatre_data(df, time = time, name = theatre,
                 wet_clinical_waste = clinical_waste,
                 wet_clinical_waste_unit = "kg",
                 desflurane = 10,
                 average = general_waste,
                 plastic_units = "kg",
                 electricity_kWh = electricity_kwh,
                 include_cpi = TRUE,
                 jurisdiction = "Australia",
                 year = 2023,
                 single_sheet = FALSE)
# }

Run the code above in your browser using DataLab