Assignment 4

Due by 11:30am on Wednesday, October 9, 2024

Instructions

This assignment is all about making figures. It’s going to be a bit free-form because when it comes to making figures, there are a silly number of options. Here are the conditions:

  • You must use the ggplot2 package and syntax. This should not be practice for base R.
  • Your choice of variables must make sense for the type of plot you are making. That is, don’t give me a histogram for a dichotomous variable (that would just be 2 bars and super weird).
  • All figures must follow the basics of clear axis labels and titles! (please don’t make me take points off for this…). I will take points off if these are missing or not clear! Do NOT use the defaults. You need to change the labels to make them publication-ready.
  • NO PIE CHARTS!

Visualizing data in different ways

Here’s your to-do list:

Pick 2 variables from your dataset. Make 3 different figures that show the relationship between these 2 variables. Your figures must include the following:

  • A theme
  • Make use of different colors (manually or with a color palette)
  • You need to pick the best of the 3 figures and explain why you think this is the case

Explanation vs. Clutter

Here’s your to-do list:

  • Make a plot that uses at least 3 geoms. Make it as beautiful, publication-ready as you can.
  • Explain whether the extra geoms help explain your data or if it just clutters everything up. You may add an additional plot if you think it help explains your answer better (e.g., if you think a plot with only 2 geoms would be better, make that plot). An extra plot is not required. The explanation is required.

Multipanel Figures

Here’s your to-do list:

  • Create a multipanel figure. You will need at least 2 variables from your dataset to do this (likely more than 2). 2 of these variables need to be new (aka not used in section 1 of this assignment). After you’ve picked 2 new variables, you can start to use other variables that were already used. For instance, if you want 3 variables, 2 must be new and 1 can be from earlier in the assignment.
  • Multipanel can be in the form of subplots or it can be in the form of different figures woven together as a single figure. You choose.
  • Keep in mind the dimensions. We should be able to easily look at your figure on a standard laptop screen without having to scroll left/right very much.
  • Think about what format the data need to be in! Use tidyverse or whatever packages are necessary in order to wrangle your data into the appropriate format to plot.

Yahhoooooooo!

We’ll talk more about the theory of data viz later in the semester. But for now, you should feel comfortable plotting in the ggplot2 world.

Go ahead and submit your code file to Canvas. If you used an outside dataset, please also submit that, too.