make_val_tree | R Documentation |
Utility function to make small directed acyclic graphs, using the data.tree package. Nodes are provided with randomly-selected numerical values.
make_val_tree(min_children = 1,
max_children = 4,
min_depth = 3,
values = 1:5,
fillcolor = "palegreen",
fontcolor = "black",
seed = NULL)
min_children |
Minimum number of children when node will not be a leaf. |
max_children |
Maximum number of children when node will not be a leaf. |
min_depth |
Nodes at less than this specified depth will not be leaves. |
values |
Numerical vector of possible values to associate with each node. |
fillcolor |
Fill color for nodes. |
fontcolor |
Fonot color for text showing node value and node name. |
seed |
Option to set the random seed. |
A tree object of class "Node" and "R6"
Homer White homerhanumat@gmail.com
## Not run:
tr <- make_val_tree(
values = 1:10,
seed = 4040,
fillcolor = "lightblue"
)
library(DiagrammeR)
plot(tr)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.