Skip to contents

Use pull 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'
pull(.data, var = -1, name = NULL, ...)

pull_set(.data, var = -1, name = NULL, ...)

pull_element(.data, var = -1, name = NULL, ...)

pull_relation(.data, var = -1, name = NULL, ...)

Arguments

.data

The TidySet object

var

The literal variable name, a positive integer or a negative integer column position.

name

Column used to name the output.

...

Currently not used.

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)))
pull(a, type)
#>  [1] "Gene"   "Gene"   "Gene"   "Gene"   "lncRNA" "lncRNA" "Gene"   "Gene"  
#>  [9] "Gene"   "Gene"   "lncRNA" "lncRNA"
# Equivalent to pull_relation
b <- activate(a, "relations")
pull_relation(b, elements)
#>  [1] "a" "b" "c" "d" "e" "f" "a" "b" "c" "d" "e" "f"
pull_element(b, elements)
#> [1] "a" "b" "c" "d" "e" "f"
# Filter element
pull_element(a, type)
#> [1] "Gene"   "Gene"   "Gene"   "Gene"   "lncRNA" "lncRNA"
# Filter sets
pull_set(a, sets)
#> [1] "a"  "b"  "a2" "b2"