Inclass exercises, Day III
Follow this link for day 2 (Introduction to Tidyverse) materials and notes
Follow this link for day 3 (Probability) materials and notes
Solutions for these exercises are available here
Exercises
Create the following figures for the R CO2
dataset using ggplot2
. When applicable, use only one line of code to create each figure by piping commands together.
- Histogram of CO2 uptake values for all plants
- Histogram of CO2 uptake values for all plants from Mississippi
- Histogram of CO2 uptake values for all plants from Mississippi. This time, provide the argument
bins=50
togeom_histogram()
, as in: geom_histogram(bins=50). Then, providebins=5
and finallybins=100
. Think about how these plots compare and therefore what this argument is doing. - Faceted histogram of CO2 uptake values across plant Type
- Scatterplot of CO2 uptake against concentration (meaning CO2 is the response variable) for all nontreated plants, where points are colored by plant Type
- Faceted scatterplot of CO2 uptake against concentration across plant Type, where points are colored by Treatment
- Faceted scatterplot of CO2 uptake against concentration across plant Type and Treatment, i.e. the final figure should have 2 rows and 2 columns.