# Run in the folder containing lesson.R. Standard R packages only.
png("selected.png", width = 1200, height = 800, res = 160,
    pointsize = 12, bg = "white")
source("lesson.R")
dev.off()
pdf("selected.pdf", width = 7.5, height = 5, pointsize = 12,
    family = "Helvetica", bg = "white", timestamp = FALSE)
source("lesson.R")
dev.off()
png("all-values.png", width = 1200, height = 800, res = 160,
    pointsize = 12, bg = "white")
barplot(height_cm, col = c("#0066CC", "#AAB3BF", "#AAB3BF", "#0066CC", "#AAB3BF", "#0066CC"),
        border = NA, ylim = c(0, 20), xlab = "Seedling", ylab = "Height (cm)",
        main = "All six seedlings; A, D, F highlighted")
dev.off()
write.csv(data.frame(seedling = names(height_cm), height_cm = as.numeric(height_cm)),
          "data.csv", row.names = FALSE)
write.csv(data.frame(seedling = names(selected), height_cm = as.numeric(selected)),
          "selected.csv", row.names = FALSE)
