Learn R Programming

BaseSet (version 0.0.17)

add_relations: Add relations to a TidySet

Description

Adds new relations to existing or new sets and elements. If the sets or elements do not exist they are added.

Usage

add_relations(object, elements, sets, fuzzy, ...)

Value

A TidySet object with the new relations.

Arguments

object

A TidySet object

elements

A character vector of the elements.

sets

A character vector of sets to be added.

fuzzy

The strength of the membership.

...

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

See Also

add_relation to add relations with new sets or/and new elements.

Other add_*: add_elements(), add_sets()

Examples

Run this code
x <- list("a" = letters[1:5], "b" = LETTERS[3:7])
a <- tidySet(x)
add_relations(a, elements = c("a", "b", "g"), sets = "d")
add_relations(a, elements = c("a", "b"), sets = c("d", "g"))
add_relations(a, elements = c("a", "b"), sets = c("d", "g"), fuzzy = 0.5)
add_relations(a,
    elements = c("a", "b"), sets = c("d", "g"),
    fuzzy = c(0.5, 0.7)
)

Run the code above in your browser using DataLab