ra_plot_tree | R Documentation |
A traditional representation of the model table is plotted using the library DiagrammeR. This function expects as an input a list object with named elements as nodes and edges, corresponding to the tables specifying the nodes of the tree and connections between them Shape and Color for the nodes are obtained directly from variables in the nodes table. If missing, default colors and shape are used
ra_plot_tree(
m,
fontColor = "black",
shape = "rectangle",
static = T,
edit = F,
edgetbl = F,
fitlabels = T,
maxchar = 10,
direction = "LR"
)
m |
Model table with columns id, label, type, distribution and formula see examples. |
fontColor |
Color of the text displayed in the figure |
shape |
shape of the nodes, options are the same from the DiagrammeR library: ellipse, oval, diamond, egg, plaintext, point, square, triangle |
static |
if TRUE, the figure will be created with DiagrammeR for a static visualization. When FALSE, visNetwork is used for a dynamic visualization |
edgetbl |
if TRUE, return a table of edges for visualization purposes |
fitlabels |
if TRUE, automatically add breaks to fit the label bsed on the maxchar argument |
maxchar |
when fitlables = TRUE, maximum number of characters before the breaks |
direction |
direction for the visualization when using visNetwork interactive, options include: UD, DU, LR, RL; corresponding to: up-down, down-up, left-right, and right-left, respectively |
a grViz/htmlwidget figure representing the risk assessment tree
# Use one of the examples from the library
m <- quantrra::OIRSA
ra_plot_tree(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.