Learn R Programming

carbonr (version 0.2.1)

ferry_emissions: Calculate CO2e emissions from ferry journeys

Description

A function that calculates CO2e emissions between ferry ports.

Usage

ferry_emissions(
  from,
  to,
  via = NULL,
  type = c("Foot", "Car", "Average"),
  num_people = 1,
  times_journey = 1,
  include_WTT = TRUE,
  round_trip = FALSE
)

Value

Returns CO2e emissions in tonnes for the ferry journey.

Arguments

from

Port code for the port departing from. Use seaport_finder to find port code.

to

Port code for the port arriving from. Use seaport_finder to find port code.

via

Optional. Takes a vector containing the port code that the ferry travels through. Use seaport_finder to find port code.

type

Whether the journey is taken on foot or by car. Options are "Foot", "Car", "Average".

num_people

Number of people taking the journey. Takes a single numerical value.

times_journey

Number of times the journey is taken.

include_WTT

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

round_trip

Whether the journey is one-way or return.

Details

The distances are calculated using the Haversine formula. This is calculated as the crow flies.

Examples

Run this code
# Emissions for a ferry journey between Belfast and New York City
seaport_finder(city = "Belfast")
seaport_finder(city = "New York")
ferry_emissions(from = "BEL", to = "BOY")

Run the code above in your browser using DataLab