1. Learn
  2. /
  3. Courses
  4. /
  5. Visualization Best Practices in R

Exercise

Categorical x-axis

In the previous charts, we saw that mumps didn't start getting reported until 1999, making comparisons before then meaningless.

Let's filter the data to be only the cases reported on or after 1999 and then make a stacked bar chart looking at the proportion of different diseases by region.

Modify the data-manipulation pipeline to get the data into the form you want, then build your stacked bar chart and plot! Don't worry about ordering the bars here as we did in the last exercise. See any surprising patterns?

Instructions

100 XP
  • Filter who_disease data to only years 1999 and later.
  • Add to group_by() to keep region information in summary.
  • Fill out aesthetics with x = region, y = total_cases, and fill = disease.