creates a new UpSet set combination structure

asCombination(
  name,
  elems = c(),
  type = "intersection",
  sets = strsplit(name, "&"),
  cardinality = length(elems),
  color = NULL
)

Arguments

name

name of the set combination

elems

the elements of the set combination

type

the set combination type (intersection,distinctIntersection,union,combination)

sets

the sets this combination is part of

cardinality

the cardinality of the set, default to length(elems)

color

the color of the set

Value

the set object

Examples

asCombination("a", c(1, 2, 3))
#> $name
#> [1] "a"
#> 
#> $type
#> [1] "intersection"
#> 
#> $elems
#> [1] 1 2 3
#> 
#> $color
#> NULL
#> 
#> $cardinality
#> [1] 3
#> 
#> $setNames
#> $setNames[[1]]
#> [1] "a"
#> 
#> 
#> $degree
#> [1] 1
#> 
#> attr(,"class")
#> [1] "upsetjs_combination"