R/knitr.R
To enable drake to watch for the dependencies
of a knitr report, the command in your workflow plan data frame
must call knitr::knit()
directly.
In other words,
the command must look something like
knit("your_report.Rmd")
or
knit("your_report.Rmd", quiet = TRUE)
.
knitr_deps(target)
target | file path to the file or name of the file target, source text of the document. |
---|
A character vector of the names of dependencies.
Drake looks for dependencies in the document by
analyzing evaluated code chunks for other targets/imports
mentioned in loadd()
and readd()
.
deps()
,
make()
, load_basic_example()
# NOT RUN { test_with_dir("Quarantine side effects.", { load_basic_example() # Get the code with drake_example("basic"). knitr_deps("'report.Rmd'") # Files must be single-quoted. # Find the dependencies of the compiled output target, 'report.md'. knitr_deps("report.Rmd") make(my_plan) # Run the project. # Work only on the Rmd source, not the output. try(knitr_deps("'report.md'"), silent = FALSE) # error }) # }