Learn R Programming

set6 (version 0.1.1)

equals: Are Two Sets Equal?

Description

Are Two Sets Equal?

Usage

# S3 method for Set
==(x, y)

# S3 method for Set !=(x, y)

Arguments

x

Set

y

Set

Value

If all is TRUE then returns TRUE if all x are equal to the Set, otherwise FALSE. If all is FALSE then returns a vector of logicals corresponding to each individual element of x.

R6 Usage

$equals(x, all = FALSE)

See Also

Other set methods: contains, isSubset

Examples

Run this code
# NOT RUN {
# Equals
Set$new(1,2)$equals(Set$new(5,6))
Set$new(1,2)$equals(Interval$new(1,2))
Set$new(1,2) == Interval$new(1,2, class = "integer")

# Not equal
!Set$new(1,2)$equals(Set$new(1,2))
Set$new(1,2) != Set$new(1,5)
# }

Run the code above in your browser using DataLab