Skip to contents

set_equal checks if two sets x and y contain the same elements. This function is similar to Python's set.__eq__() method.

Usage

sets_equal(x, y)

Arguments

x

A vector.

y

Another vector to compare with x.

Value

TRUE if x and y contain the same elements, otherwise FALSE.

Examples

sets_equal(c(1, 2, 3), c(3, 1, 2))
#> [1] TRUE