Chapter 1: Data visualization

Set up

We have already loaded the R packages you need for this tutorial. Once you start working in RStudio, you will run code like the code shown below to load the R packages you need.

Exercises

All exercises are from R for Data Science 2nd Edition.

Chapter 1: Data visualization


Ex 1 in Section 1.4.3

Fill in the blank to make a barplot of species, such that species is assigned to the y aesthetic.


Ex 5 in Section 1.5.5

Make a scatterplot of bill_depth_mm vs. bill_length_mm and color the points by species (That is a scatterplot with bill depth on the y-axis and bill length on the x-axis). What does adding coloring by species reveal about the relationship between these two variables? What about faceting by species?



Open code chunk

Here is a code chunk in case you wish to play around with some code