Structural equality of two trees: identical node kinds, child structure, leaf positions, and names.
Arguments
- a, b
(
RTree)
Trees to compare, as returned bybuild_tree().
See also
tree_diff() to locate the first divergence.
Examples
tree_equal(build_tree(list(a = 1)), build_tree(list(a = 2)))
#> [1] TRUE
tree_equal(build_tree(list(a = 1)), build_tree(list(b = 1)))
#> [1] FALSE