pls complete with the question mark(???) ```{r} #Load the libraries library(nycflights13) library(??) # for tabyl and adorn library(funModeling) # For descriptive statistics ``` Q1a) Using
pls complete with the question mark(???)
```{r} #Load the libraries library(nycflights13) library(??) # for tabyl and adorn library(funModeling) # For descriptive statistics
```
Q1a) Using the tabyl command provide a summary table for the origin variable in the flights dataset ```{r} # Add column total in the last row ??(flights,origin)%>% ??("row") ```
q1b) Create a contingency table/crosstab with the carrier and origin variable. Format and provide the row and column totals. ```{r} # Contingency table/cross-tab ??(flights, carrier, origin) %>% ??(c("row", "col")) %>% adorn_percentages("row") %>% ??formatting(digits = 1) %>% adorn_ns(position = "front") %>% #Adds the numbers along with percentage ??("combined")
```
q2a) Use appropriate command to provide the summary including mean, standard deviation, percentiles, skewness etc for the flights dataset ```{r} #Data summary ??(flights) ```
q2b) Use appropriate command to provide for the histogram of all numeric variables in the flights dataset. ```{r} #Histogram for all the numeric variables. ??(flights) ``` q3) Generate the correlation plot by including the variables - dep_delay,arr_delay,dep_time,arr_time,air_time,distance. Which variables are highly correlated? Which variables are negatively correlated?
```{r} # correlation works only with numeric variables # It will not work when there is missing values flightsinfo <- flights %>% ??(dep_delay,arr_delay,dep_time,arr_time,air_time,distance) %>% ??()%>% #remove variables cor() %>% # correlation round(2) # rounding ```
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started