Setup

library(gapminder)
data(gapminder)

Exercise: Make a Line Plot

Using the gapminder data, make a line plot showing the population of Afghanistan over time. Hint: for base R, look at the help for plot.default and the type parameter.

Make sure to clean up the x and y labels, and give your plot a title.

Exercise: Histogram

Make a histogram of life expectancies in 2007. Make the historgram with each of 5, 10, 20, and 40 bins. Does the number of bins change your interpretation of the data at all? Do you see different trends?

Exercise: Scatter Plot

Using the gapminder data, create a scatter plot of gdpPercap vs. population for year 1982. Log the x axis (hint: argument log="x"). Change the plot marker to a solid circle, color red, with a alpha value of .3.