Learn R Programming

carbonr (version 0.2.1)

airport_finder: Find the airport code for an airport

Description

Find the name, city, country, and IATA code of an airport. For use in the airplane_emissions function.

Usage

airport_finder(
  name,
  city,
  country,
  IATA_code,
  distance = 0.1,
  ignore.case = FALSE
)

Value

Data frame containing the name, city, country, and IATA code of an airport.

Arguments

name

Name of the airport.

city

City that the airport is in.

country

Country that the airport is in.

IATA_code

The IATA code.

distance

Maximum distance allowed for a match between the name/country/city given, and that of the value in the data set.

ignore.case

If FALSE, the check for is case-sensitive. If TRUE, case is ignored.

Examples

Run this code
# Can get the IATA code from the name of an airport. Gets similar matches.
airport_finder(name = "Bristo")

# Can get the IATA code from the name and city of an airport
airport_finder(name = "Bristo", country = "United Kingdom")

# Can find the name and city of an airport given the IATA code
airport_finder(IATA_code = "BRS")

Run the code above in your browser using DataLab