+ if (require("checkpoint")) {
+ required_pkgs <-
+ checkpoint:::scanForPackages(project = "_episodes_rmd",
+ verbose=FALSE, use.knitr = TRUE)$pkgs
+ } else {
+ stop("The checkpoint package is required to build the lessons.")
+ }
+
+ missing_pkgs <- required_pkgs[!(required_pkgs %in% rownames(installed.packages()))]
+
+ if (length(missing_pkgs)) {
+ message("Installing missing required packages: ",
+ paste(missing_pkgs, collapse=", "))
+ install.packages(missing_pkgs)
+ }
+
+ ## find all the Rmd files, and generate the paths for their respective outputs