Skip to contents

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, ...)

Arguments

.data

The TidySet object

...

The name of the columns you want to keep, remove or rename.

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 <- 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