Skip to contents

Use mutate to alter the TidySet object. You can use activate with mutate or use the specific function. The S3 method filters using all the information on the TidySet.

Usage

# S3 method for TidySet
mutate(.data, ...)

mutate_set(.data, ...)

mutate_element(.data, ...)

mutate_relation(.data, ...)

Arguments

.data

The TidySet object.

...

The logical predicates in terms of the variables of the sets.

Value

A TidySet object

Examples

relations <- data.frame(
    sets = c(rep("a", 5), "b", rep("a2", 5), "b2"),
    elements = rep(letters[seq_len(6)], 2),
    fuzzy = runif(12)
)
a <- tidySet(relations)
a <- mutate_element(a, Type = c(rep("Gene", 4), rep("lncRNA", 2)))
a
#>    elements sets      fuzzy   Type
#> 1         a    a 0.16456925   Gene
#> 2         b    a 0.66320658   Gene
#> 3         c    a 0.85657500   Gene
#> 4         d    a 0.92654645   Gene
#> 5         e    a 0.55237759 lncRNA
#> 6         f    b 0.57706569 lncRNA
#> 7         a   a2 0.68744775   Gene
#> 8         b   a2 0.24471823   Gene
#> 9         c   a2 0.04461716   Gene
#> 10        d   a2 0.90985456   Gene
#> 11        e   a2 0.07068122 lncRNA
#> 12        f   b2 0.99689147 lncRNA
b <- mutate_relation(a, Type = sample(c("PPI", "PF", "MP"), 12,
    replace = TRUE
))