Skip to contents

Add column to a slot of the TidySet object.

Usage

add_column(object, slot, columns)

# S4 method for TidySet,character
add_column(object, slot, columns)

Arguments

object

A TidySet object.

slot

A TidySet slot.

columns

The columns to add.

Value

A TidySet object.

Methods (by class)

  • object = TidySet,slot = character: Add a column to any slot

Examples

relations <- data.frame(
    sets = c(rep("a", 5), "b"),
    elements = letters[seq_len(6)],
    fuzzy = runif(6)
)
TS <- tidySet(relations)
add_column(TS, "relations", data.frame(well = c(
    "GOOD", "BAD", "WORSE",
    "UGLY", "FOE", "HEY"
)))
#>   elements sets     fuzzy  well
#> 1        a    a 0.8701572  GOOD
#> 2        b    a 0.3173344   BAD
#> 3        c    a 0.2032806 WORSE
#> 4        d    a 0.8751395  UGLY
#> 5        e    a 0.7755075   FOE
#> 6        f    b 0.4229602   HEY