# Calculations based on individual flights
airport_footprint("LAX", "LHR")
airport_footprint("LAX", "LHR", "First")
airport_footprint("LAX", "LHR", "First", "ch4")
airport_footprint("LAX", "LHR", output = "ch4")
# Calculations based on a data frame of flights
library(dplyr)
library(tibble)
travel_data <- tribble(~name, ~from, ~to, ~class,
"Mike", "LAX", "PUS", "Economy",
"Will", "LGA", "LHR", "Economy+",
"Elle", "TYS", "TPA", "Business")
travel_data |>
rowwise() |>
mutate(emissions = airport_footprint(from, to,
flightClass = class,
output="co2e"))
Run the code above in your browser using DataLab