Airport Data, Part 2
Here are some more examples about the Airport Data, using R:
In the year 2007, count the number of flights that originate from each airport. Which 20 airports are the most popular in this regard, i.e., in terms of having the most flights originating from those airports?
First, you need to load the data.table library, and then (afterwards), you can load the data for the 2007 flights, as follows:
library(data.table)
myDF <- fread("/anvil/projects/tdm/data/flights/subset/2007.csv")
(We needed the data.table library because it defines the fread function which is much faster and more efficient than the read.csv function from the previous question. After all, we are working with more than 7 million rows of data in this question!)
You can be sure to be able to see all of the columns (up to a maximum of 50 columns) using the command:
options(repr.matrix.max.cols=50)
Finally, make a table, sort the results, and display the biggest 20 values, as shown in the video.