# Run in the folder containing data.csv and lesson.R.
png("recorded-heights.png", width = 1200, height = 800, res = 160,
    pointsize = 12, bg = "white", family = "sans")
source("lesson.R", echo = TRUE, max.deparse.length = Inf)
dev.off()
pdf("recorded-heights.pdf", width = 7.5, height = 5, pointsize = 12,
    family = "Helvetica", bg = "white", timestamp = FALSE)
source("lesson.R")
dev.off()
write.csv(observed, "observed.csv", row.names = FALSE)
write.csv(practice, "practice.csv", row.names = FALSE)
stopifnot(nrow(seedlings)==6, ncol(seedlings)==2,
          identical(which(is.na(seedlings$height_cm)), 3L),
          identical(observed$seedling, c("A", "B", "D", "E", "F")),
          sum(observed$height_cm)==63, mean(observed$height_cm)==12.6,
          is.na(mean(seedlings$height_cm)),
          sum(practice$height_cm)==72, mean(practice$height_cm)==12,
          is.na(seedlings[3, "height_cm"]))
