Subset a single cell experiment object by sampling the number of specified cells, optionally by grouping. If neither n, frac or n_max is specified the lowest number of cells in group will be used.
sample_cells(x, ...)
# S3 method for Seurat
sample_cells(x, group = NULL, n = NULL, frac = NULL, n_max = NULL, ...)
# S3 method for SingleCellExperiment
sample_cells(x, group = NULL, n = NULL, frac = NULL, ...)
an object to sample from.
parameters passed down to methods.
optional grouping variable.
number of cells to sample (per group).
fraction of cells to sample (per group).
number of cells to sample, if less cells available then all cells returned.