Question: Exercise 2. reference the Iris data is in R studio package Filter the iris data to get observations from the versicolor species. Calculate a new
- Exercise 2. reference the Iris data is in R studio package
- Filter theirisdata to get observations from the "versicolor" species.
- Calculate a new variable, calledproduct, that is the product of Petal Length and Petal Width.
- Order the resulting data frame soproductis in increasing order (the observation with the smallest value ofproductwill be in the first row, and the observation with the largest value ofproductwill be in the last row).
- To complete the task, you should use thedplyrpackage.
- This exercise should be done in one line of code using thefilter(),mutate(), andarrange()functions separated by pipe operators (%>%).
- Hint:It may be helpful to build your code step by step, testing each step to make sure they work separately as desired.
- Your R code should be included in your R Markdown file inside an R code chunk.
- Knit the final output file.
- Submit to the Week 9 dropbox folderbothyourR Markdown fileand thepdfreport that was generated.
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
