Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rstudio library(tidyverse) library(nycflights13) flights #### 1. What is the average and standard deviation of arrival delay for each carrier? Among three major US airlines (UA,

Rstudio

library(tidyverse) library(nycflights13) flights

#### 1. What is the average and standard deviation of arrival delay for each carrier? Among three major US airlines (UA, AA, DL), which one is the best and which one is the worst in terms of delay? ```{r} flight1<- flights %>% group_by(flights, dest) %>% # set group structure for each carrier summarise(avg.arr.delay= , sd.arr.delay= ) # calculate average and standard deviation

flight1 %>% filter(flights, carrier%in%c("UA","AA","DL")) %>% # filter three airlines arrange(flights, dep_delay, desc(day)) # sort ```

#### 2. For each of the three major US airlines, how many flights have been canceled? Draw a bar chart to show your result, and label each bar with the numbers. ```{r} flights %>% filter( flights, carrier%in%c("UA","AA","DL") ) %>% # filter three airlines, and canceled flights group_by(flights$) %>% # set group structure for each carrier summarise(count= ) %>% # what is the function to get count ggplot(aes(x= , y= )) + # specify x and y on your bar chart geom_bar(stat="identity", fill="blue") + geom_text(stat="identity", aes(label=count), vjust=-0.5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What is your risk associated with Problem 10-14?

Answered: 1 week ago

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago