Question: Finally, let s create a plot that shows the relationship between a diamond s carat ( i . e . , its size ) and

Finally, lets create a plot that shows the relationship between a diamonds carat (i.e., its size) and its
selling price, but that colors each data point according to the quality of its cut. The code below will create
such a graph and add in a legend to describe how each observational point was colored. What do you
notice?
plot(diamonds$carat, diamonds$price, col = diamonds$clarity)
legend("bottomright", legend = levels(diamonds$clarity), fill = palette("default")

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!