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, ...)
See also
dplyr::mutate()
and activate()
Other methods:
TidySet-class
,
activate()
,
add_column()
,
add_relation()
,
arrange.TidySet()
,
cartesian()
,
complement_element()
,
complement_set()
,
complement()
,
element_size()
,
elements()
,
filter.TidySet()
,
group_by.TidySet()
,
group()
,
incidence()
,
intersection()
,
is.fuzzy()
,
is_nested()
,
move_to()
,
nElements()
,
nRelations()
,
nSets()
,
name_elements<-()
,
name_sets<-()
,
name_sets()
,
power_set()
,
pull.TidySet()
,
relations()
,
remove_column()
,
remove_element()
,
remove_relation()
,
remove_set()
,
rename_elements()
,
rename_set()
,
select.TidySet()
,
set_size()
,
sets()
,
subtract()
,
union()
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
))