Question: Iris flowers Write a script that reads in data, calculates some statistics, and makes plots. You are working on a new project and your colleague

Iris flowers
Write a script that reads in data, calculates some statistics, and makes plots.
You are working on a new project and your colleague has asked you to calculate some statistics of the dataset she collected in the field and to make some plots to visualize the dataset.
You need to calculate:
Mean value of Sepal Length for each species.
Median value of Sepal Width for each species.
Maximum value of Petal Length for each species.
Minimum value of Petal Width for each specie
You need to plot:
Histograms of Petal Length for each species.
The dataset looks like this:
## Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 15.13.51.40.2 setosa
## 24.93.01.40.2 setosa
## 34.73.21.30.2 setosa
## 44.63.11.50.2 setosa
## 55.03.61.40.2 setosa
## 65.43.91.70.4 setosa
Tasks
Create a new R script in RStudio
Load the iris dataset with data(iris)
Get to know the dataset by exploring it (e.g. how many species are in the dataset?)
Calculate the statistics
Create a new data frame that includes all the statistics you just calculated (think about how you arrange the rows and columns)
Plot the distribution of the Petal.Length column as a histogram for every species
Save the script
Click Source in RStudio to run it from beginning to end to make sure no error comes out

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!