Question: Write the code to execute the following steps using the diamonds data set. Use R Add a new column price_per_carat which is the price of

Write the code to execute the following steps using the diamonds data set. Use R

  • Add a new column price_per_carat which is the price of the diamond divided by its weight in carats
  • Sort the rows of the resulting tibble in descending order of price_per_carat
  • Retain only the top 1000 rows in the order above
  • For these 1000 rows, plot the distribution of color using a bar plot where your bars should be filled with the color "khaki"

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!