Skip to contents

Check if some elements are also sets of others. This is also known as hierarchical sets.

Usage

is_nested(object)

# S3 method for class 'TidySet'
is_nested(object)

Arguments

object

A TidySet object.

Value

A logical value: TRUE if there are some sets included as elements of others.

Examples

relations <- list(A = letters[1:3], B = c(letters[4:5]))
TS <- tidySet(relations)
is_nested(TS)
#> [1] FALSE
TS2 <- add_relation(TS, data.frame(elements = "A", sets = "B"))
# Note that A is both a set and an element of B
TS2
#>   elements sets fuzzy
#> 1        a    A     1
#> 2        b    A     1
#> 3        c    A     1
#> 4        d    B     1
#> 5        e    B     1
#> 6        A    B     1
is_nested(TS2)
#> [1] TRUE