Please explain with reasons for writing such code. It will help a lot. Thank you so much.

We need to make a R markdown file:

  1. Under section one, I need to make list, a named list, consisting of 3 elements df1, df2, df3 that correspond to the 3 built-in data frames mtcars, iris, and USArrests, respectively.

Then I need to write a few line of code to demonstrate a few ways that I can access the Species column in the df2 data frame.

2. Under section two, I need a short introduction to the qplot() function available from the ggplot2 package. I need to use examples to show how I need to make a scatter plot of

(1) Sepal.Length vs Sepal.Width based on the iris data frame. Note that Sepal.Length is the y variable,

(2) Sepal.Length vs Sepal.Width, coloring the points by the Species, and

(3) disp vs mpg, coloring the points by am. The variables are from the mtcars data frame.

Hint: First, take a look at the mtcars data by typing ?mtcars on the R console. Then, issue the code str(mtcars) to check the type of each column in the mtcars data. Now, issue the code mtcars$am = factor(mtcars$am), which converts the am column from numeric to categorical or discrete (as R developers called it). Now, type str(mtcars) on the console. What has changed? You are now ready to do part (3) in Section Two

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!