View source: R/09_flow_view_deps.R
flow_view_deps | R Documentation |
flow_view_deps(
fun,
max_depth = Inf,
trim = NULL,
promote = NULL,
demote = NULL,
hide = NULL,
show_imports = c("functions", "packages", "none"),
out = NULL,
lines = TRUE,
include_formals = TRUE
)
fun |
A function, can be of the form |
max_depth |
An integer, the maximum depth to display |
trim |
A vector or list of function names where the recursion will stop |
promote |
A vector or list of external functions to show as internal functions |
demote |
A vector or list of internal functions to show as external functions |
hide |
A vector or list of internal functions to completely remove from the chart |
show_imports |
Whether to show imported "functions", only "packages", or "none" |
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. |
lines |
Whether to show the number of lines of code next to the function name |
include_formals |
Whether to fetch dependencies in the default values of the function's arguments |
Exported objects are shown in blue, unexported objects are shown in yellow.
Regular expressions can be used in trim
, promote
, demote
and hide
,
they will be used on function names in the form pkg::fun
or pkg:::fun
where pkg
can be any package mentioned in these arguments, the namespace
of the explored function, or any of the direct dependencies of the package.
These arguments must be named, using the name "pattern". See examples below.
flow_view_deps()
returns a "flow_diagram"
object by default, and the output path invisibly if out
is not
NULL
(called for side effects).
flow_view_deps(here::i_am)
flow_view_deps(here::i_am, demote = "format_dr_here")
flow_view_deps(here::i_am, trim = "format_dr_here")
flow_view_deps(here::i_am, hide = "format_dr_here")
flow_view_deps(here::i_am, promote = "rprojroot::get_root_desc")
flow_view_deps(here::i_am, promote = c(pattern = ".*::g"))
flow_view_deps(here::i_am, promote = c(pattern = "rprojroot::.*"))
flow_view_deps(here::i_am, hide = c(pattern = "here:::s"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.