knitr::opts_chunk$set(
  echo = TRUE, warning = FALSE, message = FALSE,
  fig.height = 8,
  fig.width = 8.5
)
library(tidyverse)
pwalk(d4, ~ {

  root <- ..1
  dat <- ..3
  has_subs <- ..2

  cat("##", root, "\n\n")

  pwalk(dat, ~ {

    question <- ..1
    plot <- ..3

    if (has_subs) cat("###", question, "\n\n")
    print(plot)
    message("Printed ", root, " ", question) # to track progress when knitting
    cat("\n\n")

  })

})


jaydennord/nordr documentation built on March 2, 2023, 10:48 p.m.