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 class '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.4400872
#> 2         a    1   0.5599128
#> 3         b    0   0.1429164
#> 4         b    1   0.8570836
#> 5         c    0   0.6151903
#> 6         c    1   0.3848097
#> 7         d    0   0.4720830
#> 8         d    1   0.5279170
#> 9         e    0   0.3993625
#> 10        e    1   0.6006375
#> 11        f    0   0.5243893
#> 12        f    1   0.3997999
#> 13        f    2   0.0758108