Question
I need assistance with coding, in RStudio 3.5.2 Consider the iris dataset. It has 150 rows and 5 columns and contains measurements in centimeters of
I need assistance with coding, in RStudio 3.5.2
Consider the iris dataset. It has 150 rows and 5 columns and contains measurements in centimeters of the variables sepal length and width and petal length and width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica. head(iris, 3) ## Sepal.Length Sepal.Width Petal.Length Petal.Width Species ## 1 5.1 3.5 1.4 0.2 setosa ## 2 4.9 3.0 1.4 0.2 setosa ## 3 4.7 3.2 1.3 0.2 setosa Using the ggplot2 package, a) write code to create a scatter plot of Petal.Length versus Petal.Width, with the variable Species mapped to color; b) add appropriate title to the plot; c) write code to create side by side box plots of Sepal.Length for each specie of iris.
This is what I have so far what am I missing?
ggplot(data = iris)+
geom_point(mapping = aes (x = Petal.Length, y = Petal.Width))+
facet_grid(~Species, scales = "free")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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