A function that returns details of airports within a user-specified distance of a given airport.
airports_near_airport(input, distance = 100)
input | An airport name, IATA code, or ICAO code. Input type will be guessed unless explicitly defined |
---|---|
distance | Distance boundary for nearest airport lookup in kilometres |
A tibble of airports that fall within the specified range of input airport
airports_near_airport("YVR")#> # A tibble: 26 x 17 #> `OpenFlights ID` Name City IATA ICAO Country `Country Code` #> <dbl> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 33 Nana… Nana… "YCD" CYCD Canada 124 #> 2 39 Chil… Chil… "YCW" CYCW Canada 124 #> 3 104 Pitt… Pitt… "\\N" CYPK Canada 124 #> 4 156 Vanc… Vanc… "YVR" CYVR Canada 124 #> 5 175 Abbo… Abbo… "YXX" CYXX Canada 124 #> 6 184 Vict… Vict… "YYJ" CYYJ Canada 124 #> 7 3573 Whid… Whid… "NUW" KNUW United… 840 #> 8 3777 Bell… Bell… "BLI" KBLI United… 840 #> 9 4106 Vict… Vict… "YWH" CYWH Canada 124 #> 10 5493 Texa… Texa… "YGB" CYGB Canada 124 #> # … with 16 more rows, and 10 more variables: `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_near_airport("YVR", distance = 200)#> # A tibble: 43 x 17 #> `OpenFlights ID` Name City IATA ICAO Country `Country Code` #> <dbl> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 25 Tofi… Tofi… "YAZ" CYAZ Canada 124 #> 2 30 Camp… Camp… "YBL" CYBL Canada 124 #> 3 33 Nana… Nana… "YCD" CYCD Canada 124 #> 4 39 Chil… Chil… "YCW" CYCW Canada 124 #> 5 44 Prin… Prin… "\\N" CYDC Canada 124 #> 6 78 Kaml… Kaml… "YKA" CYKA Canada 124 #> 7 104 Pitt… Pitt… "\\N" CYPK Canada 124 #> 8 119 Como… Comox "YQQ" CYQQ Canada 124 #> 9 156 Vanc… Vanc… "YVR" CYVR Canada 124 #> 10 175 Abbo… Abbo… "YXX" CYXX Canada 124 #> # … with 33 more rows, and 10 more variables: `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>