Skip to contents

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)

Arguments

object

A TidySet object

relations

A data.frame object

...

Placeholder for other arguments that could be passed to the method. Currently not used.

Value

A TidySet object.

Methods (by class)

  • add_relation(object = TidySet, relations = data.frame): Adds relations

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