49 Lab: Better Viz

Conveying the right message through visualization

In this lab, our goal is to reconstruct and improve a data visualization concerning COVID-19 and mask-wearing practices. We aim to explore how data visualizations can sometimes mislead and learn techniques to correct these misrepresentations.

Learning Goals

  • Critiquing visualizations that misrepresent data
  • Constructing datasets suitable for visual analysis
  • Applying principles of effective data visualizationo to improve clarity and accuracy

Getting started

Go to the course GitHub organization and locate the template. Clone and then open the R Markdown document. Ensure it compiles without errors to confirm your setup is correct.

Warm up

Let’s warm up with some simple exercises. Update the YAML of your R Markdown file with your information, knit, commit, and push your changes. Make sure to commit with a meaningful commit message. Then, go to your repo on GitHub and confirm that your changes are visible in your Rmd and md files. If anything is missing, commit and push again.

Packages

We’ll use the tidyverse package for much of the data wrangling and visualization. This package is already installed for you. You can load it by running the following in your Console:

library(tidyverse)

Data

In this lab, you’ll be constructing the dataset!

Exercises

The following visualization was shared on Twitter as “extraordinary misleading”.

Before you dive in, think about what is misleading about this visualization and how you might go about fixing it.

  1. Create a data frame that can be used to re-construct this visualization. You may need to guess some of the numbers, that’s ok. You should first think about how many rows and columns you’ll need and what you want to call your variables. Then, you can use the tribble() function for this. For example, if you wanted to construct the following data frame
df
#> # A tibble: 3 × 2
#>   date     count
#>   <chr>    <dbl>
#> 1 1/1/2020    15
#> 2 2/1/2020    20
#> 3 3/1/2020    22

you can write

df <- tribble(
  ~date, ~count,
  "1/1/2020", 15,
  "2/1/2020", 20,
  "3/1/2020", 22,
)
  1. Make a visualization that more accurately (and honestly) reflects the data and conveys a clear message.

  2. What message is more clear in your visualization than it was in the original visualization?

  3. What, if any, useful information do these data and your visualization tell us about mask wearing and COVID? It’ll be difficult to set aside what you already know about mask wearing, but you should try to focus only on what this visualization tells. Feel free to also comment on whether that lines up with what you know about mask wearing.

Using the same dataset you constructed, your goal now is to create a new visualization that intentionally conveys the opposite message of your previous, accurate visualization. This exercise is designed to highlight the impact of visualization choices on the interpretation of data. It’s a practical exploration of how changing the presentation can alter the perceived message, underscoring the ethical implications of data visualization.

  1. Reflect on the message conveyed by your accurate visualization regarding mask-wearing and COVID-19. Discuss the key factors that contribute to this message, such as the variables used, the scale of the axes, and the type of visualization.

  2. Plan Your Opposite Visualization: Briefly determine what opposite message you want to covey. Consider the data you have available (or could easily add).

  3. Use visualization techniques to craft a chart or graph that conveys this contrary perspective. Pay careful attention to how different visualization choices, like altering the y-axis scale or changing the chart type, can influence the message received by the audience.

🧶 ✅ ⬆️ Knit, commit, and push your changes to GitHub with an appropriate commit message. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards and review the md document on GitHub to make sure you’re happy with the final state of your work.