Skip to contents

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

Usage

set_size(object, sets = NULL)

# S4 method for TidySet
set_size(object, sets = NULL)

Arguments

object

A TidySet object.

sets

The sets from which the length is calculated.

Value

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

Methods (by class)

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)
set_size(a)
#>    sets size  probability
#> 1     A    0 0.1543312531
#> 2     A    1 0.4106312751
#> 3     A    2 0.3207193042
#> 4     A    3 0.1011906709
#> 5     A    4 0.0126806078
#> 6     A    5 0.0004468889
#> 7     B    0 0.3223284860
#> 8     B    1 0.6776715140
#> 9     C    0 0.0667922643
#> 10    C    1 0.9332077357