airportMatcher: airportMatcher

Description Usage Arguments Details Value See Also Examples

View source: R/funcs.R

Description

finds the nearest airport to a set of coordinates

Usage

1
airportMatcher(returnDF, dataSet = "openFlights")

Arguments

returnDF

output of coordinateGetter

dataSet

airport database do you want to use: "openFlights" or "the other one", default = "openFlights

Details

It's a bit tough to know what airports to use, it seems all corpuses are either too detailed or not enough. For now I'm using openflights, might parametrize this later to allow for other airport lists to be selected

Value

a dataframe containing the address, the coordinates of the address, the IATA code of the nearest airport, the distance (in km) to the nearest airport, and the coordinates of the nearest airport

See Also

distm

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
if(interactive()){
 #'  library(purrr)
 addresses <- c("9th Street, Troy, NY, USA", "The Mall, Solan, Himachal Pradesh, India")
 returnDF <- purrr::map_dfr(addresses, ~coordinateGetter(.))
 airportMatcher(returnDF)
 }

## End(Not run)

DataStrategist/carbonFootprintR documentation built on Dec. 17, 2021, 4:07 p.m.