This is the code to generate PDF files from figures, and the two figures as PDF files:
## add this to make.R
make_figures <- function(path = "fig", ...) {
make_summary_by_continent(path = path, ...)
make_change_trend(path = path, ...)
}
make_summary_by_continent <- function(path = "fig", ...) {
mean_lifeExp <- get_mean_lifeExp(gather_gdp_data())
p <- plot_summary_lifeExp_by_continent(mean_lifeExp)
make_pdf(print(p), file = file.path(path, "summary_by_continent.pdf"), ...)
}
make_change_trend <- function(path = "fig", year = 1980, ...) {
mean_lifeExp <- get_mean_lifeExp(gather_gdp_data())
p <- plot_change_trend(mean_lifeExp, year = year)
make_pdf(print(p), file = file.path(path, "change_trend.pdf"), ...)
}
## -----