Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

```{r} #Load Packages library(dplyr) # Import data cars <- read.csv(\"/resources

ID: 3053348 • Letter: #

Question

```{r}

#Load Packages

library(dplyr)

# Import data

cars <- read.csv("/resources/rstudio/BusStatistics/Load Data/cars.csv")

str(cars)

#histogram

ggplot(cars, aes(x = city_mpg)) +

geom_histogram() +

facet_wrap(~suv)

# density plot

ggplot(cars, aes(x = city_mpg)) +

geom_density() +

facet_wrap(~suv)

#Box plot

ggplot(cars, aes(x = city_mpg)) +

geom_boxplot() +

facet_wrap(~suv)

```

= CC Labs File Edit Code View Plots Session Build Debug Profile Tools Help ? ? ?? -. Go to file/function | B3 ? Addins CInsert1Runs- ABC Knit - 63r 64 #Load Packages 65 library(dplyr) 67 # Import data 68 cars

Explanation / Answer

Your code is correct. but the only mistake is you have to load another package called ggplot2.

#Load Packages

library(dplyr)

library(ggplots) ## suppose you did not install ggplot2, then instal first and load it

# Import data

cars <- read.csv("/resources/rstudio/BusStatistics/Load Data/cars.csv")

str(cars)

#histogram

ggplot(cars, aes(x = city_mpg)) +

geom_histogram() +

facet_wrap(~suv)

# density plot

ggplot(cars, aes(x = city_mpg)) +

geom_density() +

facet_wrap(~suv)

#Box plot

ggplot(cars, aes(x = city_mpg)) +

geom_boxplot() +

facet_wrap(~suv)