Skip to contents

Structural equality of two trees: identical node kinds, child structure, leaf positions, and names.

Usage

tree_equal(a, b)

Arguments

a, b

(RTree)
Trees to compare, as returned by build_tree().

Value

logical(1)

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