Skip to course content
Free R data course

R Foundations for Data Analysis

Module 07 Activity

Scenario

Build the chart that will be screenshotted into somebody's slide deck.

What you build

A chart that survives being separated from its report, exported from code.

Steps

  1. Write the question the chart answers before choosing a geom, then pick the geom from the question.
  2. Describe the mapping first — which column is x, which is y, which is colour — and add layers one at a time, looking after each.
  3. If you are comparing groups, try faceting rather than overlaying, and check the number of panels is small enough to read.
  4. Set the axis deliberately. Start bar charts at zero, and label any non-zero baseline on a line chart.
  5. Write the title as the finding, put units on the axes, and use the caption for the source and the limitation the chart cannot show.
  6. Export with ggsave() at a stated size and resolution, then delete it and rebuild it to confirm it is reproducible.

Evidence to hand in

Review checklist