Coding workshop: Week 4

figures and captions
tidyverse
janitor
read_csv
ggplot
Author
Affiliation
Workshop date

April 25, 2024

Modified

June 13, 2024

1. Summary

Packages

  • tidyverse
  • janitor

Operations

Review

  • read in data using read_csv()
  • visualize data using ggplot()

Data sources

The fish migration data is from the Columbia River DART (Data Access in Real Time) on fish migration through the Columbia River Basin in 2023.

The candy rankings data is from FiveThirtyEight’s candy power rankings (source, story).

The desert rodent measurements are from the Portal Project.

The shark incident data is from Riley et al.

The trash wheel pick up data is from the Waterfront Partnership of Baltimore.

2. Code

1. Set up

a. packages

library(tidyverse)
library(janitor)

b. data

Data info:

# fish migration
# if you're working with fish data, note that these are cumulative counts
fish <- read_csv("adultdaily_1713852195_223.csv")

# candy rankings
candy <- read_csv("candy-data.csv")

# desert rodent measurements
rodents <- read_csv("rodent_surveys.csv")

# shark incidents
sharks <- read_csv("sharks.csv")

# trash wheel
trashwheel <- read_csv("trashwheel.csv")

c. Roles

Fill in the names of your group members/roles here:

  • Reporter: insert name here
    This person will report out at the end of class, summarizing notes from the note-taker (if there is one) or taking notes themselves on what the process of creating a visualization from a caption was like: were there any challenges? easy parts? etc.

  • Main coder: insert name here
    With the group’s guidance, this person will write the code for the final visualization and the text for the caption. This person will also post the figure and the caption on the google slides.

  • Note-taker (not every group will have this role): insert name here
    This person will keep track of all the steps to create the final visualization and share these notes with the reporter to summarize.

2. Create your visualization below!

My data set is [insert name of data set here].

REMEMBER TO LOOK AT YOUR DATA BEFORE STARTING

a. cleaning/summarizing (individual)

# insert code for cleaning and/or summarizing here IF NEEDED

b. exploratory visualization (individual)

Do this part on your own!

# insert code for your own exploratory visualization here

After you’re done with your exploratory visualization, discuss with your group members and decide which visualization to finalize.

c. final visualization (group)

The coder will write this in their script, but follow along on yours too!

# insert code for the finalized visualization here

Keep this visualization to yourself; you will compare the other group’s visualization to your own!

d. Write a caption

insert the text for your caption here

Copy-paste your caption into the google slides!

Check links in template script

3. Create a visualization based on the other group’s caption

Use the other group’s caption to make a visualization. They will do the same for your caption, and at the end you’ll compare their visualization to your own to see how well your caption described your figure.

a. Caption

insert the other group’s caption here

b. visualization (group)

# insert code for the other group's visualization here

Once you’re done, take a screenshot of your visualization and post it on the google slides!

RENDER YOUR DOCUMENT