Skip to contents

Given a TidySet adds new relations between elements and sets.

Usage

add_relation(object, relations, ...)

# S4 method for 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.38547989        NA
#> 2         b    A 0.10236374        NA
#> 3         c    A 0.09181055        NA
#> 4         d    A 0.80522569        NA
#> 5         e    A 0.37093349        NA
#> 6         f    B 0.36976830        NA
#> 7         a   A2 0.57839210 0.2689533
#> 8         b   A2 0.72285275 0.2711598
#> 9         c   A2 0.88829244 0.4337605
#> 10        d   A2 0.07884338 0.6667888
#> 11        e   A2 0.85482517 0.4795875
#> 12        f   B2 0.20772193 0.1201429