create_tree | R Documentation |
Constructs a Tree
objects using the XML representation from a DEXi
model.
create_tree(main_tree, which_root = "all", correct = FALSE)
main_tree |
A character or an object of class |
which_root |
an integer to indicate which tree to create among several in a .dxi or "all" (default) to create them all. |
correct |
A logical. If TRUE, use some correction function to avoid special character as " ' ". |
Iterates over every root attribute in the provided XML to create tree structures that depict the hierarchical decision model.
A list of Tree
objects, each corresponding to a unique root
attribute in the DEXi XML layout. Each tree details the root attribute,
nodes, leaves, depth, and other associated data regarding the decision
model's configuration.
# With a Path
dxi_masc2_path <- system.file("extdata", "arborescence_MASC_2_0.dxi", package = "dexisensitivity")
tree <- create_tree(dxi_masc2_path)
tree
# With an XML
dxi_masc2_path <- system.file("extdata", "arborescence_MASC_2_0.dxi", package = "dexisensitivity")
masc2_xml <- XML::xmlDeserializeHook(dxi_masc2_path)
tree <- create_tree(masc2_xml)
tree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.