Use arrange 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'
arrange(.data, ...)
arrange_set(.data, ...)
arrange_element(.data, ...)
arrange_relation(.data, ...)See also
dplyr::arrange() and activate()
Other methods:
TidySet-class,
activate(),
add_column(),
add_relation(),
cartesian(),
complement(),
complement_element(),
complement_set(),
element_size(),
elements(),
filter.TidySet(),
group(),
group_by.TidySet(),
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(),
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))
)
b <- arrange(a, desc(type))
elements(b)
#> elements type
#> 1 e lncRNA
#> 2 f lncRNA
#> 5 a Gene
#> 6 b Gene
#> 7 c Gene
#> 8 d Gene
b <- arrange_element(a, elements)
elements(b)
#> elements type
#> 1 a Gene
#> 2 b Gene
#> 3 c Gene
#> 4 d Gene
#> 5 e lncRNA
#> 6 f lncRNA
# Arrange sets
arrange_set(a, sets)
#> elements sets fuzzy type
#> 1 a A 0.20417834 Gene
#> 2 b A 0.71339728 Gene
#> 3 c A 0.06521611 Gene
#> 4 d A 0.35420680 Gene
#> 5 e A 0.82519942 lncRNA
#> 6 f B 0.27381825 lncRNA
#> 7 a A2 0.57004495 Gene
#> 8 b A2 0.33571908 Gene
#> 9 c A2 0.59626279 Gene
#> 10 d A2 0.19151803 Gene
#> 11 e A2 0.94776394 lncRNA
#> 12 f B2 0.54248041 lncRNA
