Tutorial-09

Author

Kate Saunders

Quarto Basics and Scrollytelling

Learning Objectives

  • Practice communicating your results using Quarto

    • Including practicing combining text, code, images and visualisations in the same document
  • Practice communicating your key messages by writing about your plots

  • Practice converting your Quarto into a storytelling document

Preparation

  • We will use the energy and weather data again, and the plots we created in Workshop 6.
library(tidyverse)
library(here)
energy = read_csv("data/energydata.csv")
weather = read_csv("data/weather.csv")
energy_weather = full_join(energy, weather, by = c("Date", "State"))

energy_weather |> 
  mutate(
    Day_type = if_else(Day %in% c("Sat", "Sun"),
                       "Weekend", "Weekday")
  ) |>
  ggplot(aes(x = MaxTemp, y = Demand, group = Day_type, col = Day_type)) +
  geom_point(alpha = 0.25) + 
  geom_smooth() +
  facet_wrap(vars(State), scales = "free")

Task 1

  1. Create a Quarto document that contains the above plot (don’t show your code)

  2. Write a sentence above the plot about the key message

  3. Below the plot write about the features of the plots and the key aesthetic mappings

  4. Write about any of the secondary messages or other important details

  5. Write about any important caveats

Task 2

Turn your Quarto into a scroll based story.

  1. Create a copy of your Task 1 Quarto file.

  2. Change the format to a closeread-html

  3. Make the plot a sticky object by giving it an ID (for example :::{#cr-myplot})

  4. Add the headers :::{.cr-section} for where you want the scrolling to start and ::: for where you want the scrolling to finish

  5. Inside your scrolly section, add the trigger for when you want your plot to appear and make the messages scroll by one at a time

  6. Advanced: Add in other plots to improve the telling of this data story