Skip to contents

Add column to a slot of the TidySet object.

Usage

add_column(object, slot, columns)

# S4 method for class '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)

  • add_column(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.03424133  GOOD
#> 2        b    a 0.32038573   BAD
#> 3        c    a 0.40232824 WORSE
#> 4        d    a 0.19566983  UGLY
#> 5        e    a 0.40353812   FOE
#> 6        f    b 0.06366146   HEY