add_grouping: Add a cell grouping to a dataset

View source: R/wrap_add_grouping.R

add_groupingR Documentation

Add a cell grouping to a dataset

Description

Add a cell grouping to a dataset

Usage

add_grouping(dataset, grouping, group_ids = NULL, ...)

is_wrapper_with_grouping(dataset)

get_grouping(dataset, grouping = NULL)

Arguments

dataset

A dataset created by wrap_data() or wrap_expression()

grouping

A grouping of the cells, can be a named vector or a dataframe with group_id and cell_id

group_ids

All group identifiers, optional

...

Extra information to be stored in the dataset

Value

A dynwrap object with the grouping added.

Examples

dataset <- example_dataset

grouping <- sample(c("A", "B", "C"), length(dataset$cell_ids), replace = TRUE)
names(grouping) <- dataset$cell_ids

dataset <- add_grouping(dataset, grouping)
head(dataset$grouping)


dynwrap documentation built on July 26, 2023, 5:15 p.m.