View source: R/03_0_flow_view.R
flow_view | R Documentation |
flow_view()
shows the code of a function as a flow diagram, flow_run()
runs a call and draws the logical path taken by the code.
flow_view( x, prefix = NULL, code = TRUE, narrow = FALSE, truncate = NULL, nested_fun = NULL, swap = TRUE, out = NULL, engine = c("nomnoml", "plantuml") ) flow_run( x, prefix = NULL, code = TRUE, narrow = FALSE, truncate = NULL, swap = TRUE, out = NULL, browse = FALSE )
x |
a call, a function, or a path to a script |
prefix |
prefix to use for special comments in our code used as block headers,
must start with |
code |
Whether to display the code in code blocks or only the header,
to be more compact, if |
narrow |
|
truncate |
maximum number of characters to be printed per line |
nested_fun |
if not |
swap |
whether to change |
out |
a path to save the diagram to. Special values "html", "htm", "png", "pdf", "jpg" and "jpeg" can be used to export the object to a temp file of the relevant format and open it, if a regular path is used the format will be guessed from the extension. |
engine |
either |
browse |
whether to debug step by step (block by block),
can also be a vector of block ids, in this case |
On some system the output might sometimes display the box character when using
the nomnoml engine, this is due to the system not recognizing the Braille
character \u2800
. This character is used to circumvent a nomnoml shortcoming:
lines can't start with a standard space and multiple subsequent spaces might be collapsed.
To choose another character, set the option flow.indenter
, for instance :
options(flow.indenter = "\u00b7")
.
flow_view()
returns NULL
invisibly, or the output path invisibly if out
is not
NULL
(called for side effects). flow_run()
returns the output of the wrapped call.
flow_view(rle) flow_run(rle(c(1, 2, 2, 3)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.