5 Lab Exercise 3
In this exercise, you’re going to work on different kinds of plots using ggplot2. Create a (commented) script in R to document your code. Your datasets will be:
The iris
dataset
The mtcars
dataset
The rock
dataset
Each of these contains combinations of categorical and numerical variables. Descriptions of these datasets can be found using the ? to access R help. Using data in these datasets, create a barplot or a histogram using the appropriate data types from of these.
Finally, using the gapminder dataset (from the gapminder package), create a subset of data from European nations, then plot GDP and life expectancy, coloring the points by year.
Once you’re done, submit the script and all 4 plots to the Canvas assignment page.