Page 1 of 1

nycflights13 R file nycflights13.R For all questions you should load tidyverse and nycflights13. You should not need to

Posted: Tue Jul 12, 2022 8:28 am
by answerhappygod
nycflights13
R file nycflights13.R
For all questions you should load tidyverse andnycflights13. You should not need to use any otherlibraries.
If the tidyverse package is not installed, you’ll need to do aone-time installation from the Console Window in RStudio likethis:install.packages("tidyverse")
If the nycflights13 package is not installed, you’ll need to doa one-time installation from the Console Window in RStudio likethis:install.packages("nycflights13")
Load tidyverse with:suppressPackageStartupMessages(library(tidyverse))
Load nycflights13 with:suppressPackageStartupMessages(library(nycflights13))
The actual data set is called flights.Round all float/dbl values to two decimal places.
All statistics should be run with variables in the order Istate
E.g., “Run a regression predicting mileage from mpg, make, andtype” would be:
lm(mileage ~ mpg + make + type...)
What is the mean distance of flights for each of the carriersAA, EV, and FL?
This answer should be assigned to Q1.
For the month with the highest number of flights, what is thatvalue? Hint: use head(1).
This answer should be assigned to Q2.
Find the five shortest minimum distances, called min_dist, byorigin/destination combination.
This answer should be assigned to Q3 and appear like this:
origin dest min_dist <chr> <chr> <dbl>1 [value] [value] [value]2 [value] [value] [value]3 [value] [value] [value]4 [value] [value] [value]5 [value] [value] [value]
What five days of the year had the highest mean distance whenleaving from JFK? Sort in descending order.
The answer should be assigned to Q4 and appear like this:
month day mean_distance1 [value] [value] [value]2 [value] [value] [value]3 [value] [value] [value]4 [value] [value] [value]5 [value] [value] [value]
Calculate the maximum arrival delay for flights to Boston andAtlanta, separately.
The answer should be assigned to Q5 and appear like this:
dest max_arr_delay <chr> <dbl>1 [value] [value]2 [value] [value]