Learn R Programming

carbonr (version 0.2.1)

seaport_finder: Check the code or name of a seaport

Description

Find the name and/or code of a seaport. For use in the ferry_emissions function.

Usage

seaport_finder(city, country, port_code, distance = 0.1, ignore.case = FALSE)

Value

Data frame containing the country, city, country code, port code, latitude, and longitude of a seaport.

Arguments

city

Name of the city.

country

Name of the country.

port_code

Name of the port.

distance

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

ignore.case

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

Examples

Run this code
# Look up the city of Aberdeen to find the port_code for it
seaport_finder(city = "Aberdeen")

# Search for a country and city and it finds matches
seaport_finder(country = "United", city = "borunemouth", ignore.case = TRUE)

Run the code above in your browser using DataLab