A function that returns details of all airports within a user-specified distance of an input coordinate location. Takes as input a longitude and latitude argument.

airports_around(lat, lon, distance = 100)

Arguments

lat

Latitude in decimal degrees

lon

Longitude in decimal degrees

distance

Distance boundary for nearest airport lookup in kilometres

Value

A tibble of airports that fall within the specified range of specified location

Examples

airports_around(-123,49.2)
#> # A tibble: 0 x 17 #> # … with 17 variables: `OpenFlights ID` <dbl>, Name <chr>, City <chr>, #> # IATA <chr>, ICAO <chr>, Country <chr>, `Country Code` <chr>, `Country Code #> # (Alpha-2)` <chr>, `Country Code (Alpha-3)` <chr>, Latitude <dbl>, #> # Longitude <dbl>, Altitude <dbl>, UTC <dbl>, DST <chr>, Timezone <chr>, #> # Type <chr>, Source <chr>
# Or with a user specified distance in kilometres airports_around(-123, 49.2, distance = 200)
#> # A tibble: 0 x 17 #> # … with 17 variables: `OpenFlights ID` <dbl>, Name <chr>, City <chr>, #> # IATA <chr>, ICAO <chr>, Country <chr>, `Country Code` <chr>, `Country Code #> # (Alpha-2)` <chr>, `Country Code (Alpha-3)` <chr>, Latitude <dbl>, #> # Longitude <dbl>, Altitude <dbl>, UTC <dbl>, DST <chr>, Timezone <chr>, #> # Type <chr>, Source <chr>