Exercise

Bar plots: sequential color palette

In this bar plot, we'll fill each segment according to an ordinal variable. The best way to do that is with a sequential color palette.

Here's an example of using a sequential color palette with the mtcars dataset:

ggplot(mtcars, aes(fcyl, fill = fam)) +
  geom_bar() +
  scale_fill_brewer(palette = "Set1")

In the exercise, you'll use similar code on the the Vocab dataset. Both datasets are ordinal.

Instructions 1/3

undefined XP
    1
    2
    3
  • Plot the Vocab dataset, mapping education onto x and vocabulary onto fill.