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
- Write the question the chart answers before choosing a geom, then pick the geom from the question.
- Describe the mapping first — which column is x, which is y, which is colour — and add layers one at a time, looking after each.
- If you are comparing groups, try faceting rather than overlaying, and check the number of panels is small enough to read.
- Set the axis deliberately. Start bar charts at zero, and label any non-zero baseline on a line chart.
- 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.
- Export with
ggsave()at a stated size and resolution, then delete it and rebuild it to confirm it is reproducible.
Evidence to hand in
- The question, and the geom you chose for it.
- The chart built up layer by layer.
- The faceted version, if you made one.
- The axis decision and its justification.
- The title, axis labels and caption.
- The exported file, rebuilt from code.
Review checklist
- Every bar chart starts its axis at zero.
- The title states the finding, not the topic.
- Units appear on the axes and the source in the caption.
- Any limitation the bars cannot show is written in the caption.
- The file was exported by
ggsave()and regenerated, not screenshotted.
