Tools for analyzing the dataflow graph of a knitr input document based on code chunk dependencies. The package includes functions for extracting dependencies and other chunk profiling information, which can be visualized and further analyzed.
The main function is knit_flow
. It knits a document and extracts
the necessary data for the flow graph.
The function dataflow_graph
can be used inside the last knitr chunk
to save the graph instead.
When using knit_flow
, the option .__grab = TRUE
has to
be set in a last (extra and empty) chunk, and the optional option .__flow = TRUE
can be
set to get chunk dependency tracking and timing. You can track and time individual chunks, or
set it as a global option to time all chunks.
An alternative to calling knit_flow
is to add knitrflow::set_hooks()
to
an initial (uncached) chunk and knitrflow::dataflow_graph(file = "flow.RData")
to the last chunk (the one with option '.__grab = TRUE'). Then the flow graph
is stored in a file whenever the document is knitted. It can subsequently be loaded,
plotted and further analyzed in R.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.