Learn R Programming

BaseSet (version 1.0.0)

union_closed: Union closed sets

Description

Tests if a given object is union-closed.

Usage

union_closed(object, ...)

# S3 method for TidySet union_closed(object, sets = NULL, ...)

Value

A logical value: TRUE if the combinations of sets produce already existing sets, FALSE otherwise.

Arguments

object

A TidySet object.

...

Other named arguments passed to FUN.

sets

The name of the sets to be used.

Examples

Run this code
l <- list(A = "1",
     B = c("1", "2"),
     C = c("2", "3", "4"),
     D = c("1", "2", "3", "4")
)
TS <- tidySet(l)
union_closed(TS)
union_closed(TS, sets = c("A", "B", "C"))
union_closed(TS, sets = c("A", "B", "C", "D"))

Run the code above in your browser using DataLab