lkppie.blogg.se

R markdown for mac
R markdown for mac








r markdown for mac

\\ĥ & PDX & DL & 5168 & Delta Air Lines Inc. \\Ĥ & PDX & UA & 6061 & United Air Lines Inc. \\ģ & PDX & OO & 9841 & SkyWest Airlines Inc. \\Ģ & PDX & WN & 11193 & Southwest Airlines Co. print(xtable(by_airline),ġ & PDX & AS & 12844 & Alaska Airlines Inc. We will focus on producing the \(\LaTeX\) code in this example. The xtable package and its xtable function (and also the kable function you saw earlier) provide the functionality to generate HTML code or \(\LaTeX\) code to produce a table. data("airlines", package = "pnwflights14")īy_airline % group_by(origin, carrier) %>% We merge the flights data with the airlines data to get the names of the airlines from the two letter carrier code. The xtable package to produce nice tables in a PDFĪgain, we find ourselves using the extremely helpful dplyr package to answer this question and to create the underpinnings of our table to display. 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.

r markdown for mac

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)) %>% We’ll use the top_n function to isolate the 5 worst mean arrival delays. To address the first question, we will use the dplyr package written by Hadley Wickham as below. How many flights departed for each airline from each of the airports? How does the maximum departure delay vary by month for each of the two airports?ģ. Which destinations had the worst arrival delays (on average) from the two PNW airports?Ģ. The questions I will analyze by creating tables areġ. Here I will delve further into some of the questions I addressed in two recent workshops I led in the Fall 2015 Data Reed Research Skills Workshop Series. The dataset provides for the development of a lot of interesting questions. # Install Chester's pnwflights14 package (if not already)ĭevtools::install_github("ismayc/pnwflights14")ĭata("flights", package = "pnwflights14") # If there are any packages in the list that aren't installed, # names of the packages not installed to the variable new.pkg # Check if packages are not installed and assign the

r markdown for mac

# List of packages required for this analysis










R markdown for mac