Question: use R as coding language Question 7 The objective of this question is to introduce the matplotO function and give further practice with optional arguments
use R as coding language

Question 7 The objective of this question is to introduce the matplotO function and give further practice with optional arguments and low level functions. (a) Compute the mean price for each color and cut combination in the diamonds data, and store the result. The result should be a matrix object, where the rows correspond to the levels of color and the columns correspond to the levels of cut. Him: This computation can be done with one command. (b) The matplot 0 function plots columns of a matrix (or plots columns of one matrix against the columns of another). Use the matplot 0 function on the output from (a) to create a line plot with a separate line for each level of cut. a Distinguish each line by separate line types, line widths, and for colors of your choice. 0 Use the xaxt = "n" argument to suppress the tick marks and labels on the m-axis, then use the axis() function to set the at-aans labels to be the levels of the color variable. a Add a legend that explains the differences in the lines in the plot. (C) Interpret the line plot from (13). Does it appear that the mean price of diamonds differs for different levels of color? For different levels of cut? Which levels tend to have higher mean prices
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
