buildChapterGraph {rebook} | R Documentation |
Build the dependency graph between chapter based on their extractCached
calls to each other.
buildChapterGraph(dir, recursive = TRUE, pattern = "\\.Rmd$")
dir |
String containing the path to the directory containing Rmarkdown reports.
This is searched recursively for all files ending in |
recursive |
Further arguments to pass to |
pattern |
Further arguments to pass to |
A directed graph object from the igraph package, where each node is a chapter and is connected to its dependencies by an edge.
Aaron Lun
dir <- tempfile() dir.create(dir) tmp1 <- file.path(dir, "alpha.Rmd") write(file=tmp1, "```{r, echo=FALSE, results='asis'} rebook::chapterPreamble() ``` ```{r} rodan <- 1 ```") tmp2 <- file.path(dir, "bravo.Rmd") write(file=tmp2, "```{r, echo=FALSE, results='asis'} rebook::chapterPreamble() ``` ```{r} extractCached('alpha.Rmd') ```") # Building the chapter graph: g <- buildChapterGraph(dir) plot(g)