Mathilde Stiernet
Mathilde Stiernet

Reputation: 13

How is air_time calculated in flights data set of nycflights13 package R

I am analysing the flights dataset of the nycflights13 package in R.

I have an issue understanding how exactly the air_time is calculated.

My code to view the data, starting with the shortest flights:

library(nycflights13)
library(tidyverse)
view(arrange(flights, air_time))

The first line viewed, for instance, contains the following information:

I also know that air_time is given in minutes as documented here: https://cran.r-project.org/web/packages/nycflights13/nycflights13.pdf

I would expect the air_time to be the time passed, in minutes, between the actual departure and the actual arrival. In other words in this case, the flight departed 5 minutes before 2 o'clock and arrived at 14:42, so I would expect to have a 47 minutes duration. However, the duration mentioned is 20. Other data elements, like scheduled timings do not seem to clarify. I thought about time differences at first but this also does not help.

Another indirectly related questions already exists but did not help me figure out clearly how air_time is defined: Why do I get negative non-airtime in the nycflights13 dataset

If you have a clue, please let me know :)

Upvotes: 1

Views: 1128

Answers (1)

Mateus
Mateus

Reputation: 86

The R for Data Science: Exercise Solutions by Jeffrey B. Arnold, when showing the resolution for exercise 5.5.2 discusses that:

[...] flights data does not contain the variables TaxiIn, TaxiOff, WheelsIn, and WheelsOff. It appears that the air_time variable refers to flight time, which is defined as the time between wheels-off (take-off) and wheels-in (landing). But the flight time does not include time spent on the runway taxiing to and from gates

See also "Air time" on the glossary page from the Bureau of transportation statistics (the source of the data):

The airborne hours of aircraft computed from the moment an aircraft leaves the ground until it touches the ground at the end of a flight stage.

All that corroborates Edward's comment on the question.

Upvotes: 1

Related Questions