Problem set: Workflow

Overview

For this one you are going to go out into the wild. Look through the Data Is Plural newsletter and find a dataset that you think is interesting. There’ll be some trial and error: some won’t be easy to work with out of the box. But that’s the point! You’ll need to figure out how to wrangle the data into a format that you can work with.

Everything happens inside your camp project. Save the raw data in data/ and never edit it by hand. The thing you make is a short Quarto report: 05_report.qmd at the top level of your project (next to the .Rproj file). You can start from this morning’s file or from a blank one. Set it up like this morning’s pipeline: raw data in, a figure out, nothing done by hand.

It is your report: for any line in it, you should be able to say what it does.

What the report needs

  1. Read the data with here(). Say in the text where the data came from and what one row is
  2. Wrangle it into a shape you can work with. Say how many rows you started with and how many you ended with. If you dropped missing values, say how many
  3. One figure that shows something about the data, with labels, a theme, and a caption (#| fig-cap:). Hide the code with #| echo: false
  4. Numbers written with inline code. Every number in your text comes from R, none typed by hand
  5. One citation. Cite the dataset (or a paper that uses it). Add it to Zotero from the real source page, export a .bib file, and cite it with @. Your report should end with a reference list
  6. A few sentences on what you found. If you report a percent, say what it is a percent of

Check it

Before you call it done:

  • Check one number by hand. Pick one number in your report and compute it a second way. Does it match?
  • The adversarial agent. Open a fresh agent session and ask it to review 05_report.qmd without changing it: anything that could make the results wrong or misleading, and how you can check each one. Write down one thing it flagged and whether it was right
  • Restart R and render, top to bottom, from a fresh session. If it works then, it works

Nothing is turned in. At the end of the afternoon, each person gets two minutes to show one figure and say what it shows.