add_child {forestry} | R Documentation |
Add children node
Description
Add children node
Usage
add_child(main_tree, x, assign_node)
Arguments
main_tree |
the parent tree to be appended with children node |
x |
xth child |
assign_node |
appended node as child |
Value
reshaped tree with children assigned
Examples
data("test_df")
data("exercise_df")
test_node <- data.tree::as.Node(test_df)
test_exercise <- data.tree::as.Node(exercise_df)
add_child(main_tree = test_node, x = 4, assign_node = test_exercise )
print(test_node)
[Package forestry version 0.1.1 Index]