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 class '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.2449280   Gene
#> 2         b    a 0.7811226   Gene
#> 3         c    a 0.2882372   Gene
#> 4         d    a 0.8753579   Gene
#> 5         e    a 0.2957501 lncRNA
#> 6         f    b 0.9835254 lncRNA
#> 7         a   a2 0.5898376   Gene
#> 8         b   a2 0.7591584   Gene
#> 9         c   a2 0.8360753   Gene
#> 10        d   a2 0.7628195   Gene
#> 11        e   a2 0.4172699 lncRNA
#> 12        f   b2 0.1380748 lncRNA
b <- mutate_relation(a, Type = sample(c("PPI", "PF", "MP"), 12,
    replace = TRUE
))