2.5 Boxplots and Violin Plots

The iris dataset contains measurements on 150 flowers of three different species.


Load the iris dataset.

data("iris")


View the iris dataset like a spreadsheet.

View(iris)


Use a boxplot to compare the Petal.Length between different species of flowers in the iris dataset

ggplot(iris, aes(x=Species, y=Petal.Length)) + geom_boxplot()


According to your boxplot, which species of flower has the longest petals?

virginica


Use a violin plot to compare the Petal.Length between different species of flowers in the iris dataset

ggplot(iris, aes(Species, y=Petal.Length)) + geom_violin()