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.6110205   Gene
#> 2         b    a 0.3712520   Gene
#> 3         c    a 0.6587169   Gene
#> 4         d    a 0.2545755   Gene
#> 5         e    a 0.4708421 lncRNA
#> 6         f    b 0.8036590 lncRNA
#> 7         a   a2 0.8429263   Gene
#> 8         b   a2 0.6486316   Gene
#> 9         c   a2 0.8465375   Gene
#> 10        d   a2 0.6626717   Gene
#> 11        e   a2 0.4252383 lncRNA
#> 12        f   b2 0.5946822 lncRNA
b <- mutate_relation(a, Type = sample(c("PPI", "PF", "MP"), 12,
    replace = TRUE
))