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
## setosa
## setosa
## setosa
## setosa
## setosa
## setosa
Tasks
Create a new R script in RStudio
Load the iris dataset with datairis
Get to know the dataset by exploring it eg 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
