The Mad Hatter’s Guide to Data Viz and Stats in R
  1. Data Viz and Stats
  2. Studio Flow and Data Kits
  3. 12-Day Studio Index
  • Data Viz and Stats
    • Tools
      • Introduction to R and RStudio
    • Studio Flow and Data Kits
      • 12-Day Studio Index
      • Healthcare Data Kits
    • Descriptions
      • Data
      • Inspect Data
      • Graphs
      • Summaries
      • Counts
      • Quantities
      • Groups
      • Distributions
      • Groups and Distributions
      • Change
      • Proportions
      • Hierarchy
      • Evolution and Flow
      • Ratings and Rankings
      • Surveys
      • Time
      • Space
        • Introduction to Maps
        • What is Vector Data?
        • The Grammar of Maps
        • Interactive Maps with leaflet
      • Networks
      • Miscellaneous Graphing Tools, and References
    • Inference
      • Basics
      • 🎲 Samples
      • Randomization
      • One Mean
      • Two Independent Means
      • Two Paired Means
      • Multiple Means (ANOVA)
      • Correlation
      • One Proportion
      • Two Proportions
    • Modelling
      • Modelling with Linear Regression
      • Modelling with Logistic Regression
      • 🕔 Modelling and Predicting Time Series
    • Workflow
      • Facing the Abyss
      • I Publish, therefore I Am
      • Data Carpentry
    • Arts
      • Colours
      • Fonts
      • Annotations
      • More Annotations
      • Highlighting
      • Scales
    • AI Tools
      • Using gander and ellmer
      • Using Github Copilot and other AI tools to generate R code
      • Using LLMs to Explain Stat models
    • Case Studies
      • Demo:Product Packaging and Elderly People
      • Ikea Furniture
      • Movie Profits
      • Gender at the Work Place
      • Heptathlon
      • School Scores
      • Children’s Games
      • Valentine’s Day Spending
      • Women Live Longer?
      • Hearing Loss in Children
      • California Transit Payments
      • Seaweed Nutrients
      • Coffee Flavours
      • Legionnaire’s Disease in the USA
      • Antarctic Sea ice
      • William Farr’s Observations on Cholera in London
    • Projects
      • No Free Hunch

On this page

  • 1 Introduction
  • 2 How I use this page
  • 3 What is this Wall?
  • 4 What a Panel is
  • 5 Day 1 — The bench
  • 6 Day 2 — What data even is
  • 7 Day 3 — Look, then one plot
  • 8 Day 4 — Summarise, then Git
  • 9 Day 5 — Groups and “compared to what?”
  • 10 Day 6 — Shape, share, mosaic
  • 11 Day 7 — Creepers
  • 12 Day 8 — Space, static
  • 13 Day 9 — Space, interactive
  • 14 Day 10 — No free hunch
  • 15 Day 11 — Workflow as craft
  • 16 Day 12 — Compose and stand behind it
  • 17 End-of-studio checklist
  1. Data Viz and Stats
  2. Studio Flow and Data Kits
  3. 12-Day Studio Index

12-Day Studio Index

Brick by Brick — The Mad Hatter’s Guide

Author

Arvind V.

1 Introduction

This R-based Studio is 10 FULL days of studio work. Inspired by a desire to subvert Pink Floyd, I intend to use a “Brick by Brick” approach, where a new concept, design hack, or a piece of code, are introduced for say 15 minutes max, and the students get to play while I walk around the class to meet them at individual group tables to clarify doubts.

The students use these “bricks” to create their own metaphorical R based Analysis / Viz Wall, which includes several Panels, complete with Creepers and Rick-Morty colour palettes, all using RStudio + Quarto + Github + Netlify.

2 How I use this page

Each brick is at most 15 minutes of introduction from me. Then they play. While I walk the tables.

Any discovery made by the students at one table is immediately announced and broadcast to all groups and becomes a brick for everyone.

By the end of Day 10, each group has one Quarto site on GitHub + Netlify: an analysis / viz Wall, with Panels, with Creepers, a palette that is theirs, and at least one claim they can defend.

Rule of the wall: a brick that does not appear in their question, their data, or their map does not count.

My Literary asides and calling them “peasants” will stay. They are part of Studio Voice and Rhythm.

3 What is this Wall?

The wall is a polyptych: several panels, one hinge.

The hinge is the spine (place, theme, role) that holds the Panels together. This is the theme for all datasets that have been given to the students. E.g. Healthcare, Transportation, Education…

Each Panel is a PRIMM cycle with a dataset chosen for the mark / geom.

Fonts and palettes are the Creepers and frame that makes the Wall one work.

4 What a Panel is

A panel is a short PRIMM cycle with its own data, its own geom / mark, and its own claim — same brick grammar every time:

  • See the table — what is a case, which columns are Qual / Quant
  • Ask — one question that this table can answer
  • Choose a mark — geom / map mark / stat-test that matches the question
  • Predict — what they think they will see
  • Make — human brick, then optional one AI prompt
  • Say — caption + one sentence they will stand behind
  • Limit — what this panel cannot do (often: “no Quant here, so no histogram”)

That last line is the pedagogy. Peasants learn that the chart is not a costume you put on any spreadsheet and get grades.


5 Day 1 — The bench

Wall by evening: RStudio opens. A Quarto file with their names renders. They can run one chunk. Errors are allowed to stay on the page.

Brick 15-minute target Make
Where things live Project folder, kit folder, .qmd is a file not a website yet Create studio-wall.qmd from the kit template (or copy it in)
Console vs chunk ⌘/Ctrl + Enter; green play; the number in the margin Run the load chunk for panel-A.csv
When it breaks Read the first error line; paths, quotes, missing commas Fix one broken path as a table (you seed a typo)
Render HTML appears; they know preview ≠ publish Render with group names as title
Sushi groups A characteristic reorganises the room 5 lines: what grouped you
Save and close They can find the file tomorrow Commit nothing yet. Close and reopen the project.

Steal-this cue: first peasant who reads the error instead of asking you to look at the screen.


6 Day 2 — What data even is

Wall by evening: every column on Panel A tagged Quant / Qual. One joint question written. Hunch sentence exists (not collected).

Brick 15-minute target Make
Kandinsky nouns Which abstracts are measurable 8 nouns from the room; circle the variables
Nature of data Experiment vs observation; a row is a case Point at one row of Panel A; name the case
Variable types How many / what kind / who Tag every Panel A column
Types are questions One can-ask / must-not-ask per column Two lines on the wall
Joint pair Quant+Qual / Qual+Qual / Quant+Quant One licensed question using two columns
Tidy data Column = variable, row = case Sketch a tidy version of a messy phone table

Steal-this cue: first peasant who notices that a number (BirthOrder, Year, PIN, smok before recode) is still Qual.


7 Day 3 — Look, then one plot

Wall by evening: inspect notes + one working plot from Panel A. No git.

Brick 15-minute target Make
Inspect glimpse, head, missingness Three questions the table can answer; one it cannot
Grammar of a graph Aesthetic ↔︎ variable; geom as metaphor Same two variables named; geom not yet drawn
First bar or histogram One working gf_ / ggplot from their Panel A Plot that answers one licensed question
Labels Units on the axis; no Var1 Rewrite defaults
The error again Mapping vs data vs geom Change one aesthetic on purpose and say what moved
Caption draft Title is a sentence One line under the figure

Steal-this cue: first group that puts units in the axis title without being told.


8 Day 4 — Summarise, then Git

Wall by evening: a summary sentence + a second plot. Repo exists. Broken push is allowed.

Brick 15-minute target Make
Favstats Mean, median, sd as descriptions “Typical X is …, but …”
Counts A bar that is a count of Qual Readable labels
Second geom Same question, different metaphor Which lie do they prefer
Git born git init / GitHub / first commit Push the Quarto page
What a commit is Message says why, not update Second commit after a tiny fix
Paths after clone Kit CSVs travel with the project Confirm a classmate can see the repo

Steal-this cue: first commit message that is a claim.


9 Day 5 — Groups and “compared to what?”

Wall by evening: a grouped comparison on Panel A. Live URL or a written plan to deploy tomorrow if the room is still drowning in git.

Brick 15-minute target Make
Quant + Qual Amount split by kind One plot of a Quant vs a Qual they care about
Groups Facet or fill that changes the story Same plot, now split
Colour = Qual Legend readable Recolour by a category
Colour = Quant Sequential vs diverging Caption why the scale type changed
Two-sample brick Plot first, then the matching test on the kit “We used ___ because the question was two means”
Caption as claim Title + subtitle + caption Rewrite the variable-name title

Steal-this cue: first peasant who refuses a rainbow on ordered data.

Netlify if the room is ready: paste the URL at the top. If not, first thing Day 6.


10 Day 6 — Shape, share, mosaic

Wall by evening: one distribution + one part-to-whole from Panel B if the mark needs two Quals. Palette named.

Brick 15-minute target Make
Distributions Histogram / density / box as different lies Two geoms of the same Quant
Violins & groups Shape and group together A grouped violin that survives critique
Panel B open This table has no honest histogram of the Qual Write the mismatch out loud
Proportions / mosaic Stack, dodge, waffle, mosaic — on purpose One Qual+Qual figure
Chi-square / prop.test Beside the mosaic, on the kit Match the card; plot above the p
Palette contract Why this palette on this wall Two lines of justification

Steal-this cue: first group that annotates a single peak instead of colouring everything.


11 Day 7 — Creepers

Wall by evening: type, annotation, highlight, scale on panels they already have. No new dataset unless a table is stuck. Netlify URL live if it was not.

Brick 15-minute target Make
Netlify leftover Drag-and-drop or Git-connected URL at the top of the page
Colour with intent Qual vs seq vs div as craft Can a colour-blind peasant read it?
Fonts One display, one text No third font
Annotate A sentence on the plot Not only in the prose
Highlight Grey the field, colour the argument A “this, not that” chart
Scales Limits, log, %, ₹ Fix one dishonest default

Steal-this cue: first peasant who uses annotation instead of a third colour.


12 Day 8 — Space, static

Wall by evening: one static map of Panel C or a place they can name. Geometry may still be ugly.

Brick 15-minute target Make
Map as mark Choropleth vs cartogram vs symbol Name the mark on an example
Rate vs count Fill is a rate unless they argue Refuse a count choropleth
Join Country name to rnaturalearth / World List unmatched labels — that is a brick
Bounding box (optional) Only if a table wants feet-on-ground A bbox or skip and stay on Panel C
Static grammar One honest layer + caption No default grey soup
CRS in one sentence Why things miss One line in the Quarto

Steal-this cue: first group that refuses to choropleth a count.


13 Day 9 — Space, interactive

Wall by evening: one leaflet or a second static map that argues. OSM only if a table walks up to that ledge.

Brick 15-minute target Make
Leaflet Marker vs popup vs label Their points + one honest popup
Popup as claim Not a data dump One sentence in the balloon
OSM tags (optional) One key–value family; write .gpkg Do not hammer OSM
Contours / Rapid Editor Only if hungry Leave the quarry standing
Map caption What the map will not say 4–6 lines
Two maps, one spine Static + leaflet or two claims Shared title that is the spine

Steal-this cue: first group that maps something they verified with their feet — or that writes the unmatched-join list without shame.


14 Day 10 — No free hunch

Morning: protocol and collect or tighten the kit test they already ran. Afternoon: the card on their sample if they collected; otherwise a second kit pair.

Hunch → question type → test

If the hunch is… Type Reach for
A’s typical value ≠ B’s Two means Two-sample + both distributions
Three+ groups of different people Several means ANOVA + grouped plot
Same people, several conditions Within / repeated Friedman or paired tests — not ordinary ANOVA
More than half think X One proportion prop.test vs 0.5 (or their rate)
Two groups, different rates Two proportions prop.test on a 2×2
Category vs category Association Chi-square + mosaic
“Looks bigger,” no group Stop EDA. No p-value on a vibe
Brick 15-minute target Make
Hunch as a sentence A claim that could be false One line (may already exist from Day 2)
Question type Circle the row Do not pick the test yet
Sample + ethics Who, how many, consent, no names 6-line protocol
Collect or reuse Morning clipboards or kit pair Data in a tidy sheet
Match the card Point at their row “We used ___ because ___”
Plot before p Figure above the number Parent-language interval or sentence

Steal-this cue: first peasant who changes the hunch after seeing the sample, and says so. First wrong card (ordinary ANOVA on three TV ratings from the same person) is pinned on the wall.


15 Day 11 — Workflow as craft

Wall by evening: Welcome / Data / Viz / Claim / Map. Commits a stranger could follow. Prompt log if AI was used.

Brick 15-minute target Make
Quarto as document YAML, sections, one reference Contents = rooms of the wall
Replayable code Paths; “run from here” A classmate can run a chunk
Git as history Five commits that are not all update Messages that say why
AI as apprentice One stuck brick; prompt kept They must explain the chunk
Refactor Kill the duplicate plot Keep the one that argues
Spine at the top One sentence Delete pages that do not serve it

Steal-this cue: first group whose commit message is a claim.


16 Day 12 — Compose and stand behind it

No new concept unless a table is stuck.

Brick 15-minute target Make
Argument order Data → see → claim A critic can walk the site
Accessibility Contrast; colour not the only channel Greyscale or a second encoding
Critique Claim first, syntax last Three notes from another group; accept one
Netlify final Working links URL on the board
90-second defence Question, method, what they will not claim Spoken
Limits + gift Sample, missingness, test not run Steal-this: palette / tag / annotation, with names

Steal-this cue: a brick borrowed from another table, credited on the page.


17 End-of-studio checklist

Back to top
Studio Flow and Data Kits
Healthcare Data Kits

License: CC BY-SA 2.0

Website made with ❤️ and Quarto, by Arvind V.

Hosted by Netlify .