Use select to extract the columns of a TidySet object. You can use activate with filter or use the specific function. The S3 method filters using all the information on the TidySet.
Usage
# S3 method for class 'TidySet'
select(.data, ...)
select_set(.data, ...)
select_element(.data, ...)
select_relation(.data, ...)
See also
dplyr::select()
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()
,
mutate.TidySet()
,
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()
,
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 <- mutate_set(a, Group = c("UFM", "UAB", "UPF", "MIT"))
b <- select(a, -type)
elements(b)
#> elements
#> 1 a
#> 2 b
#> 3 c
#> 4 d
#> 5 e
#> 6 f
b <- select_element(a, elements)
elements(b)
#> elements
#> 1 a
#> 2 b
#> 3 c
#> 4 d
#> 5 e
#> 6 f
# Select sets
select_set(a, sets)
#> elements sets fuzzy type
#> 1 a a 0.71518613 Gene
#> 2 b a 0.87263030 Gene
#> 3 c a 0.98328375 Gene
#> 4 d a 0.21856299 Gene
#> 5 e a 0.66453006 lncRNA
#> 6 f b 0.38956404 lncRNA
#> 7 a a2 0.04606364 Gene
#> 8 b a2 0.61691456 Gene
#> 9 c a2 0.59847499 Gene
#> 10 d a2 0.40685363 Gene
#> 11 e a2 0.85832815 lncRNA
#> 12 f b2 0.51768118 lncRNA