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)
Methods (by class)
element_size(TidySet)
: Calculates the number of sets an element appears withlength_set()
See also
cardinality
Other sizes:
set_size()
Other methods:
TidySet-class
,
activate()
,
add_column()
,
add_relation()
,
arrange.TidySet()
,
cartesian()
,
complement_element()
,
complement_set()
,
complement()
,
elements()
,
filter.TidySet()
,
group_by.TidySet()
,
group()
,
incidence()
,
intersection()
,
is.fuzzy()
,
is_nested()
,
move_to()
,
mutate.TidySet()
,
nElements()
,
nRelations()
,
nSets()
,
name_elements<-()
,
name_sets<-()
,
name_sets()
,
power_set()
,
pull.TidySet()
,
relations()
,
remove_column()
,
remove_element()
,
remove_relation()
,
remove_set()
,
rename_elements()
,
rename_set()
,
select.TidySet()
,
set_size()
,
sets()
,
subtract()
,
union()
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