Teaching ggplot2 through competitive, browser-based practice
Department of Econometrics and Business Statistics, Monash University
Data visualisation is not just syntax.
Students need to connect:
ggplot2 grammarStudents can watch an expert build a plot and still be unsure how to start the next one.
The missing skill is often translation:
target visualisation -> code choices

Make the invisible expert loop visible, social, and fast.
ggplotbattles turns plot recreation into a short competitive activity:
ggplot2 code in the browser


๐๐คบ
Battle file R plus quarto-like metadata
๐
Browser R webR runs code without local setup
๐ผ๏ธ
Render target and attempt become images
๐
Compare pixel-by-pixel similarity
๐
Revise students iterate in place
#| title: "Penguin Distributions"
#| dataset-name: "palmerpenguins::penguins"
#| colours: "`c('darkorange', 'purple', 'cyan4')`"
#| description: "Recreate the target plot using the data provided."
library(ggplot2)
library(dplyr)
ggplot(penguins, aes(x = bill_length_mm, fill = species)) +
geom_density(alpha = 0.6) +
scale_fill_manual(values = c("darkorange", "purple", "cyan4"))134 consenting students in the class list
92 / 42 undergraduate / postgraduate
2 mini-tasks with pre/post quizzes
ETC1010/ETC5510 Introduction to Data Analysis, Monash University.
ggplotbattlesIntroductory ggplot2 concepts:
More connected visualisation choices:
79% mean pre-quiz score, Task 1
94% mean pre-quiz score, Task 2
37 task attempts with room to improve
The full-sample analysis mostly measures what the quiz could detect.
ggplotbattles seems most useful when the task requires several connected ggplot2 decisions.
That is the setting where immediate visual feedback can help students:
Students learn data visualisation by making code choices, seeing the visual consequences, and trying again.
ggplotbattles gives that loop a classroom shape.
