ABSTRACT

Calculating statistics by group is one useful way to analyze the Sandy flight-delay data. Another helpful technique is visualizing data by groups. This chapter deals with ggplot’s facet_grid() and facet_wrap(), color palettes, and packages to customize and expand ggplot2 functionality. Faceting generates separate graphs for each group in a data frame. It will be useful for visualizing the percent of cancelled flights by airport and day. If a reporter or transportation policy analyst in Atlanta wants to see how that city’s air traffic was affected by cancelled (direct) flights originating at New York airports, then the code which visualizes cancellations by airport and destination can be run, but filtering the departing_cancelled_raw data set for destination Atlanta. When looking at data by geography such as country or state, an obvious option might be to create a map.