library(tidyverse)
library_visits <- read_csv(
"data/plv-library-visits.csv",
show_col_types = FALSE
)
victoria_visits <- library_visits |>
filter(service == "Victoria (Total)") |>
mutate(
financial_year = factor(
financial_year,
levels = c("2022-23", "2023-24", "2024-25")
),
visits_per_person = branch_visits / municipal_population,
visit_label = scales::label_number(
scale = 1e-6,
suffix = "m",
accuracy = 0.1
)(branch_visits)
) |>
arrange(financial_year)
visit_change <- victoria_visits |>
summarise(
first_year_visits = first(branch_visits),
last_year_visits = last(branch_visits),
percentage_change = last_year_visits / first_year_visits - 1
)ETC5523: Communicating with Data
Tutorial 3: Build and test a web data story
π― Objectives
By the end of this tutorial, you will be able to:
- turn a supported claim into a standalone Quarto webpage;
- connect a headline, lede and visual to the same comparison;
- separate essential context from methods detail; and
- render and test a small website as a reader.
This is a 40-minute tutorial. The data preparation and plotting code are supplied so that you can concentrate on shaping, building and testing the story.
1. Start with the evidence and choose the story (8 minutes)
The data come from the Public Libraries Victoria 2024-25 Annual Statistical Survey. A branch visit is an in-person visit to a branch library.
The supplied code below loads a prepared extract, selects the published statewide totals and calculates visits per person and the percentage change.
These figures give you two possible angles:
| Measure | 2022-23 | 2024-25 | Change |
|---|---|---|---|
| In-person branch visits | 20.1 million | 24.2 million | +20.3% |
| Municipal population | 6.62 million | 6.98 million | +5.4% |
| Branch visits per person | 3.04 | 3.47 | +14.1% |
The figures count visits, not unique visitors. They exclude mobile-library, delivery, outreach and online use. They show that use changed, but not why it changed.
Choose an angle
Decide which result your page will lead with:
- total branch visits rose by about one-fifth; or
- branch visits per person increased, so the rise was larger than population growth.
Write four short notes:
- Audience: who needs to know?
- Claim: what exact result will you state?
- Evidence: which values support it?
- Qualification: what must the reader not infer?
Then draft a headline of no more than 12 words and a lede of no more than 35 words.
2. Create the website (5 minutes)
In RStudio, choose File > New Project > New Directory > Quarto Website and name the project library-story.
Alternatively, use a terminal:
quarto create project website library-storyReplace _quarto.yml with:
project:
type: website
website:
title: "Victorian public library story"
navbar:
left:
- href: index.qmd
text: Story
- href: methods.qmd
text: Methods
format:
html:
theme: cosmo
toc: trueCreate methods.qmd beside index.qmd. Create a data folder, then download the prepared PLV extract into it as plv-library-visits.csv.
library-story/
βββ _quarto.yml
βββ index.qmd
βββ methods.qmd
βββ data/
βββ plv-library-visits.csv
3. Write the story page (12 minutes)
Replace index.qmd with this opening:
---
title: "[Your result-bearing headline]"
author: "[Your name]"
date: today
---
[Your lede of no more than 35 words.]Copy the two R code chunks from Start with the evidence below your lede. Keep the figure label fig-library-visits; you may change both chunks to echo: false once they work.
Below the figure, add:
## [A heading that states a finding]
[Explain what @fig-library-visits shows, why it matters to your
audience, and what the data cannot establish.]
[Read how the visits were measured](methods.qmd).Your paragraph should:
- interpret the comparison rather than repeat every value;
- define the measure as in-person branch visits;
- mention the most important limitation; and
- avoid causal language.
4. Add the methods page (7 minutes)
Paste this starter into methods.qmd, then replace the bracketed text:
---
title: "How the visits were measured"
---
The data come from the [Public Libraries Victoria Annual Statistical
Survey](https://www.plv.org.au/resources/) and cover the financial
years 2022-23 to 2024-25.
## Measure
A branch visit is an in-person visit to a branch library. The figures
count visits rather than unique visitors. [Explain why that matters.]
## Coverage and limitation
The analysis uses the published Victorian total. It excludes mobile
libraries, collection deliveries, outreach activities and online use.
[State one conclusion the data cannot support.]
[Return to the Victorian public library visits story](index.qmd).Keep the source, comparison and material limitation on the story page. Put fuller definitions and extraction details here. Leave software operations and unused service rows out of the readerβs main path.
5. Render and test (8 minutes)
Preview the site:
quarto previewOpen both pages from the navigation and narrow the browser window. Then give a partner 20 seconds on the story page and ask:
- What changed, and by how much?
- What does βvisitβ mean?
- What can the data not establish?
- Can you find the methods and return to the story?
Record the answers without explaining your intention. Revise one element they misunderstood, then render the complete project:
quarto render