Return the complement for a set
Usage
complement_set(object, sets, ...)
# S4 method for class 'TidySet,characterORfactor'
complement_set(
object,
sets,
name = NULL,
FUN = NULL,
keep = TRUE,
keep_relations = keep,
keep_elements = keep,
keep_sets = keep
)
Arguments
- object
A TidySet object.
- sets
The name of the set to look for the complement.
- ...
Placeholder for other arguments that could be passed to the method. Currently not used.
- name
Name of the new set. By default it adds a "C".
- FUN
A function to be applied when performing the union. The standard union is the "max" function, but you can provide any other function that given a numeric vector returns a single number.
- keep
Logical value to keep all the other sets.
- keep_relations
A logical value if you wan to keep old relations.
- keep_elements
A logical value if you wan to keep old elements.
- keep_sets
A logical value if you wan to keep old sets.
Methods (by class)
complement_set(object = TidySet, sets = characterORfactor)
: Complement of the sets.
See also
Other complements:
complement_element()
,
complement()
,
subtract()
Other methods that create new sets:
complement_element()
,
intersection()
,
subtract()
,
union()
Other methods:
TidySet-class
,
activate()
,
add_column()
,
add_relation()
,
arrange.TidySet()
,
cartesian()
,
complement_element()
,
complement()
,
element_size()
,
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("A", "A", "B", "B", "C", "C"),
elements = letters[seq_len(6)],
fuzzy = runif(6)
)
TS <- tidySet(relations)
complement_set(TS, "A")
#> elements sets fuzzy
#> 1 a A 0.19151803
#> 2 b A 0.94776394
#> 3 c B 0.54248041
#> 4 d B 0.54460339
#> 5 e C 0.27859715
#> 6 f C 0.44670247
#> 7 a ∁A 0.80848197
#> 8 b ∁A 0.05223606