Now that we have functions to generate the datasets we need for our paper, we can start using them to generate the figures.
To illustrate this concept, we are going to generate a figure before converting it into a function.
gdp <- read.csv(file="data-output/gdp.csv") gdp %>% filter(country %in% c("United States", "France", "Zimbabwe", "South Africa")) %>% ggplot(aes(x = year, y = lifeExp, color = country)) + geom_point(aes(size = gdpPercap)) + geom_line() + geom_vline(xintercept = 1985, color = "red", linetype = 2)