Lab 04 - Ugly charts

NEW: Join RStudio Cloud here: https://rstudio.cloud/spaces/34062/join?access_code=%2FoMkTUWkzo8%2B7q86yRe0FlKhrcpmgwsk7sCNnNNH

And then click on new project from Git.

Given below are three data visualizations that violate many data visualization best practices. Improve these visualizations using R and the tips for effective visualizations that we introduced in class. You should produce one visualization per dataset. Your visualizaiton should be accompanies by a brief paragraph describing the choices you made in your improvement, specifically discussing what you didn’t like in the original plots and why, and how you addressed them in the visualization you created.

On the due date you will give a brief presentation describing one of your improved visualizations and the reasoning for the choices you made.

Learning goals

Hello (again) teams!

First things first: get to know your team members. You can find your team assignment for the rest of the semester here.

If there are any issues with the team roster, please let one of the tutors or the professor know asap!

Getting started

Go to the course GitHub organization and locate your Lab 04 repo, which should be named lab-04-ugly-charts-YOUR_TEAMNAME. Grab the URL of the repo, and clone it in RStudio. Refer to Lab 01 if you would like to see step-by-step instructions for cloning a repo into an RStudio project.

First, open the R Markdown document lab-04-ugly-charts.Rmd and Knit it. Make sure it compiles without errors. The output will be in the file markdown .md file with the same name.

Hello Git!

Your email address is the address tied to your GitHub account and your name should be first and last name.

Before we can get started we need to take care of some required housekeeping. Specifically, we need to do some configuration so that RStudio can communicate with GitHub. This requires two pieces of information: your email address and your name.

Run the following (but update it for your name and email!) in the Console to configure git:

library(usethis)
use_git_config(user.name = "Your Name", 
               user.email = "your.email@address.com")

Workflow

This is the second week you’re working in teams, so we’re going to make things a little more interesting and let all of you make changes and push those changes to your team repository. Sometimes things will go swimmingly, and sometimes you’ll run into merge conflicts. So our first task today is to walk you through a merge conflict!

Merge conflicts

Set up

Let’s cause a merge conflict!

Take turns in completing the exercise, only one member at a time.

Tips for collaborating via GitHub

Packages

Run the following code in the Console to load this package.

library(tidyverse)

Take a sad plot and make it better

Fisheries

Fisheries and Aquaculture Department of the Food and Agriculture Organization of the United Nations collects data on fisheries production of countries. This Wikipedia page lists fishery production of countries for 2016. For each country tonnage from capture and aquaculture are listed. Note that countries whose total harvest was less than 100,000 tons are not included in the visualization.

A researcher shared with you the following visualization they created based on these data 😳.

  1. Can you help them make improve it? First, brainstorm how you would improve it. Then create the improved visualization and write up the changes/decisions you made as bullet points. It’s ok if some of your improvements are aspirational, i.e. you don’t know how to implement it, but you think it’s a good idea. Ask a tutor for help, but also keep an eye on the time. Implement what you can and leave note identfying the aspirational improvements.

✅ ⬆️ Commit and push your changes to GitHub with an appropriate commit message again. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards.

Wrapping up

Go back through your write up to make sure you’re following coding style guidelines we discussed in class. Make any edits as needed.

Also, make sure all of your R chunks are properly labeled, and your figures are reasonably sized.

Once the team leader for the week pushes their final changes, others should pull the changes and knit the R Markdown document to confirm that they can reproduce the report.

More ugly charts

Want to see more ugly charts?