MyNixOS website logo
Description

Query 'nycflights13'-Like Air Travel Data for Given Years and Airports.

Supplies a set of functions to query air travel data for user- specified years and airports. Datasets include on-time flights, airlines, airports, planes, and weather.

anyflights

CRANstatus Build status Codecov testcoverage NetlifyStatus

The anyflights package supplies a set of functions to generate air travel data (and data packages!) similar to nycflights13. With a user-defined year and airport, the anyflights function will grab data on:

  • flights: all flights that departed a given airport in a given year and month
  • weather: hourly meterological data for a given airport in a given year and month
  • airports: airport names, FAA codes, and locations
  • airlines: translation between two letter carrier (airline) codes and names
  • planes: construction information about each plane found in flights

The package also exports a set of functions to query each of the above datasets individually. Each of the functions are named get_* followed with the names of the datasets (shown above in code), and require a varying combination of the station (character vector of FAA LID airport codes), year (as an integer), and month (integer vector) arguments. Optionally, the user can also supply a dir argument (filepath to a folder) to save the resulting datasets.

These functions require a strong connection to run; expect several minutes of runtime, especially for the anyflights and get_flights functions.

The FAA usually posts all of the data for a given year during February or March of the following year. All airports with an FAA LID code are supported, to my knowledge. Data queries earlier than 2013 are significantly less thoroughly tested than those 2013 and on.

Installation


anyflights is now on CRAN! Install with the following code:

install.packages("anyflights")

To install the developmental version, use the following code:

#install.packages("remotes")
remotes::install_github("simonpcouch/anyflights")

Basic Usage


To grab a named list of 5 dataframes giving nycflights13-like air travel data for the Portland International Airport during June 2019, you could call:

pdxflights19 <- anyflights("PDX", 2019, 6)

To grab the original nycflights13 datasets, try:

nycflights13_ <- anyflights(c("JFK", "LGA", "EWR"), 2013)

The package also provides an as_flights_package function to create a data-only package from the data outputted by anyflights. To create the package from the data, just supply a name:

pdxflights19 %>%
  as_flights_package("pdxflights")

and check out the data-only package in the pdxflights directory! 🐛

If you have used anyflights to create a data package, please link me to the repository and I might feature it here! Please do not submit the outputted package to CRAN or similar repositories as original packages.

Contributing


Contributions to anyflights, whether in the form of bug fixes, issue reports, new code or documentation improvements are encouraged and welcome. Please see CONTRIBUTING.md if you’re interested in contributing!

Metadata

Version

0.3.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows