check-scalar-sets | R Documentation |
Set comparisons
isSubset(x, y)
isSuperset(x, y)
areDisjointSets(x, y)
areIntersectingSets(x, y)
areSetEqual(x, y)
x |
Object. |
y |
Object. |
TRUE
on success;
FALSE
on failure, with cause set.
Updated 2023-10-02.
assertive.sets::is_subset()
.
assertive.sets::is_superset()
.
assertive.sets::are_disjoint_sets()
.
assertive.sets::are_intersecting_sets()
.
assertive.sets::are_set_equal()
.
## 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.