Traverse a tree or a sub-tree
Traverse(node, traversal = c("pre-order", "post-order", "in-order", "level",
"ancestor"), pruneFun = NULL, filterFun = NULL)
the root of a tree or a sub-tree that should be traversed
any of 'pre-order' (the default), 'post-order', 'in-order', 'level', or 'ancestor'
allows providing a a prune criteria, i.e. a function taking a Node
as an input, and returning TRUE
or FALSE
.
If the pruneFun returns FALSE for a Node, then the Node and all its sub-tree will not be considered.
allows providing a a filter, i.e. a function taking a Node
as an input, and returning TRUE
or FALSE
.
Note that if filter returns FALSE
, then the node will be excluded from the result (but not the entire subtree).
a list of Node
s