Skip to contents

Assuming that the fuzzy values are probabilities, calculates the probability of being of different sizes for a given set.

Usage

element_size(object, elements = NULL)

# S4 method for TidySet
element_size(object, elements = NULL)

Arguments

object

A TidySet object.

elements

The element from which the length is calculated.

Value

A list with the size of the elements or the probability of having that size.

Methods (by class)

  • element_size(TidySet): Calculates the number of sets an element appears with length_set()

Examples

relations <- data.frame(
    sets = c(rep("A", 5), "B", "C"),
    elements = c(letters[seq_len(6)], letters[6]),
    fuzzy = runif(7)
)
a <- tidySet(relations)
element_size(a)
#>    elements size probability
#> 1         a    0   0.1551754
#> 2         a    1   0.8448246
#> 3         b    0   0.2190898
#> 4         b    1   0.7809102
#> 5         c    0   0.0795231
#> 6         c    1   0.9204769
#> 7         d    0   0.2358130
#> 8         d    1   0.7641870
#> 9         e    0   0.2300078
#> 10        e    1   0.7699922
#> 11        f    0   0.2184191
#> 12        f    1   0.5767077
#> 13        f    2   0.2048732