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.96425648   Gene
#> 2         b    a 0.13008734   Gene
#> 3         c    a 0.91055101   Gene
#> 4         d    a 0.72144984   Gene
#> 5         e    a 0.45154439 lncRNA
#> 6         f    b 0.40545438 lncRNA
#> 7         a   a2 0.58823326   Gene
#> 8         b   a2 0.06000679   Gene
#> 9         c   a2 0.34025153   Gene
#> 10        d   a2 0.18291398   Gene
#> 11        e   a2 0.03257438 lncRNA
#> 12        f   b2 0.92555932 lncRNA
b <- mutate_relation(a, Type = sample(c("PPI", "PF", "MP"), 12,
    replace = TRUE
))