Builds a new list tree whose children are the given trees, reassigning leaf indices contiguously across all children (in order).
Arguments
- children
(
listofRTree)
The child trees.- names
(
NULL|character())
Optional names for the children.
Examples
combined <- tree_concat(
list(build_tree(list(1, 2)), build_tree(3)),
names = c("value", "grad")
)
tree_size(combined)
#> [1] 3