Skip to contents

sets_isdisjoint checks if two or more sets have no elements in common. This function mimics Python's set.isdisjoint() method, which returns TRUE if the sets are disjoint.

Usage

sets_isdisjoint(x, ...)

Arguments

x

A vector.

...

Additional vectors to compare with x.

Value

TRUE if x and other vectors have no elements in common, otherwise FALSE.

Examples

sets_isdisjoint(c(1, 2, 3), c(4, 5, 6))
#> [1] TRUE
sets_isdisjoint(c(1, 2, 3), c(3, 4, 5))
#> [1] FALSE