Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

group

Create a new set from existing elements


Description

It allows to create a new set given some condition. If no element meet the condition an empty set is created.

Usage

group(object, name, ...)

## S3 method for class 'TidySet'
group(object, name, ...)

Arguments

object

A TidySet object.

name

The name of the new set.

...

A logical condition to subset some elements.

Value

A TidySet object with the new set.

See Also

Examples

x <- list("A" = c("a" = 0.1, "b" = 0.5), "B" = c("a" = 0.2, "b" = 1))
TS <- tidySet(x)
TS1 <- group(TS, "C", fuzzy < 0.5)
TS1
sets(TS1)
TS2 <- group(TS, "D", fuzzy < 0)
sets(TS2)
r <- data.frame(
    sets = c(rep("A", 5), "B", rep("A2", 5), "B2"),
    elements = rep(letters[seq_len(6)], 2),
    fuzzy = runif(12),
    type = c(rep("Gene", 2), rep("Protein", 2), rep("lncRNA", 2))
)
TS3 <- tidySet(r)
group(TS3, "D", sets %in% c("A", "A2"))

BaseSet

Working with Sets the Tidy Way

v0.0.16
MIT + file LICENSE
Authors
Lluís Revilla Sancho [aut, cre] (<https://orcid.org/0000-0001-9747-2570>), Zebulun Arendsee [rev], Jennifer Chang [rev]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.