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
Get step-by-step solutions from verified subject matter experts
