A logical mask over the leaves (in flat order) that is TRUE for every
leaf sitting under a top-level child whose name is in groups. An empty
groups yields an all-FALSE mask.
Arguments
- tree
(
RTree)
A tree whose root is a list node.- groups
(
character())
Top-level child names to mark.
Examples
tree_leaf_mask(build_tree(list(a = 1, b = list(2, 3))), "b")
#> [1] FALSE TRUE TRUE