This function shows one or more inductive code trees.

show_inductive_code_tree(
  x,
  codes = ".*",
  output = "both",
  headingLevel = 3,
  nodeStyle = list(shape = "box", fontname = "Arial"),
  edgeStyle = list(arrowhead = "none"),
  graphStyle = list(rankdir = "LR")
)

Arguments

x

A rock_parsedSources object (the result of a call to rock::parse_sources).

codes

A regular expression: only code trees from codes coded with a coding pattern with this name will be shown.

output

Whether to show the code tree in the console (text), as a plot (plot), or both (both).

headingLevel

The level of the heading to insert when showing the code tree as text.

nodeStyle, edgeStyle, graphStyle

Arguments to pass on to, respectively, data.tree::SetNodeStyle(), data.tree::SetEdgeStyle(), and data.tree::SetGraphStyle().

Value

x, invisibly, unless being knitted into R Markdown, in which case a knitr::asis_output()-wrapped character vector is returned.