Given a TidySet adds new relations between elements and sets.
Usage
add_relation(object, relations, ...)
# S4 method for class 'TidySet,data.frame'
add_relation(object, relations)
See also
Other methods:
TidySet-class
,
activate()
,
add_column()
,
arrange.TidySet()
,
cartesian()
,
complement_element()
,
complement_set()
,
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(rep("A", 5), "B"),
elements = letters[seq_len(6)],
fuzzy = runif(6)
)
TS <- tidySet(relations)
relations <- data.frame(
sets = c(rep("A2", 5), "B2"),
elements = letters[seq_len(6)],
fuzzy = runif(6),
new = runif(6)
)
add_relation(TS, relations)
#> elements sets fuzzy new
#> 1 a A 0.38870131 NA
#> 2 b A 0.97554784 NA
#> 3 c A 0.28989230 NA
#> 4 d A 0.67838043 NA
#> 5 e A 0.73531960 NA
#> 6 f B 0.19595673 NA
#> 7 a A2 0.98053967 0.03123033
#> 8 b A2 0.74152153 0.22556253
#> 9 c A2 0.05144628 0.30083081
#> 10 d A2 0.53021246 0.63646561
#> 11 e A2 0.69582388 0.47902455
#> 12 f B2 0.68855600 0.43217126