dynwrap (version 1.2.1)

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

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataCamp Workspace