Session Ready
Exercise

The interactive bar chart

You've likely encountered a bar chart before. With plotly you can now turn those dull, basic bar charts into interactive masterpieces!

You will work again with the diamonds dataset. The goal is to create a bar chart that buckets our diamonds based on quality of the cut. Next, for each cut, you want to see how many diamonds there are for each clarity variable.

Exciting!

Instructions
100 XP
  • The plotly and dplyr package are already loaded in.
  • Calculate the number of diamonds for each cut/clarity combination using the count() function from the dplyr) package. Assign the result to diamonds_bucket.
  • Create a chart of type "bar". The color of the bar depends on the clarity of the diamond. Bucket your diamonds by the cut over the x-axis.