Reference no: EM133471943
Case Study: Download and read the data set SYRflights2021.rds from Brightspace and save it in the same folder as your R Notebook file. Then read it into RStudio and call it syr for simplicity. This data set contains flights data from the Syracuse Airport in 2021, which is similar to the New York flights dataset that we have seen in class and has the same variables. Please use an R Notebook to answer the following questions and submit the HTML file.
Question 1. Load tidyverse and write a code to print the first 3 rows of the dataset. What are the names of columns in this dataset?
Question 2. Use one of the functions we have learned so far to get the structure of the syr dataset and understand the variables included the dataset. What types of data we have in this dataset?
Question 3. Find all flights with more than 5 hours delayed arrival that flew to New York City (there are 3 airports with the codes JFK, LGA, and EWR in this city). How many flights match these two conditions?
Question 4. In the first three months of 2021, how many flights to CLT have been operated by American Airlines (AA) or Republic Airways (YX) with the more than 110 and less than 120 minutes air time? Show these cases in a table.
Question 5. Use 2 different approaches that we have learned in class, to create 2 new variables called distance_km1 and distance_km2 and convert the distance from miles to KM (note that 1 mile = 1.61 KM). Make sure that both variables are added to the syr dataset. Next, create a new dataset called df_new by selecting the following columns: MONTH, carrier, distance_km1, distance_km2, and all the columns that their name
ends with "time". Finally show the last 4 rows of this dataset.
Question 6. Using the dataset df_new, create an interactive count plot to show the number of observations for each carrier at different months and color them "gold". Hint, make sure that the values on axes makes sense and appear correctly. In addition, add "Number of
observations in different months for different carriers", "Month of the year" and "Airline Code" as the main title of the plot and axes titles, respectively. Overall, which carrier operated year-round and had the highest flights in all months? Which carrier operated only in November and December 2021 and what was the total number of flights by this carrier?