check-scalar-sets: Set comparisons

check-scalar-setsR Documentation

Set comparisons

Description

Set comparisons

Usage

isSubset(x, y)

isSuperset(x, y)

areDisjointSets(x, y)

areIntersectingSets(x, y)

areSetEqual(x, y)

Arguments

x

Object.

y

Object.

Value

TRUE on success; FALSE on failure, with cause set.

Note

Updated 2023-10-02.

See Also

  • assertive.sets::is_subset().

  • assertive.sets::is_superset().

  • assertive.sets::are_disjoint_sets().

  • assertive.sets::are_intersecting_sets().

  • assertive.sets::are_set_equal().

Examples

## TRUE ====
isSubset(x = "a", y = c("a", "b"))

## This assert is particularly useful for checking required columns.
isSuperset(
    x = colnames(datasets::ChickWeight),
    y = c("Time", "weight", "Diet")
)

areDisjointSets(x = c("a", "b"), y = c("c", "d"))
areIntersectingSets(x = c("a", "b"), y = c("b", "c"))
areSetEqual(x = c("a", "b"), y = c("b", "a"))

## FALSE ====
isSubset(x = "c", y = c("a", "b"))
isSuperset(
    x = c("Time", "weight", "Diet"),
    y = colnames(datasets::ChickWeight)
)

areDisjointSets(x = c("a", "b"), y = c("b", "a"))
areIntersectingSets(x = c("a", "b"), y = c("c", "d"))
areSetEqual(x = c("a", "b"), y = c("b", "c"))

acidgenomics/goalie documentation built on Dec. 11, 2023, 11:36 p.m.