![]() The DT package provides a nice interface for viewing data frames in R. Summarize(max_delay = max(dep_delay, na.rm = TRUE)) dep_delays_by_month % group_by(origin, month) %>% In order to answer the second question, we’ll again make use of the various functions in the dplyr package. Surprisingly, the airport in Bellingham, WA (only around 100 miles north of SEA) had the fifth largest mean arrival delay. ![]() Houston also had around a 10 minute delay on average. Oddly enough, flights to Cleveland (from PDX and SEA) had the worst arrival delays in 2014. Lastly we output this table cleanly using the kable function. Rename("Airport Name" = name, "Airport Code" = dest, "Mean Arrival Delay" = mean_arr_delay) data("airports", package = "pnwflights14") Here we will do a match to identify the names of these airports using the inner_join function in dplyr. One of the other data sets included in the pnwflights14 package is airports that lists the names. This information is helpful but you may not necessarily know to which airport each of these FAA airport codes refers. Summarize(mean_arr_delay = mean(arr_delay, na.rm = TRUE)) %>% # List of packages required for this analysis We begin by ensuring the needed packages are installed and then load them into our R session. (More information and the source code for this R package is available at. In what follows, I’ll discuss these different options using data on departing flights from Seattle and Portland in 2014. One of the neat tools available via a variety of packages in R is the creation of beautiful tables using data frames stored in R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |