Subsets a categorical vector to include up to a maximum number of values for each category.

subsampleCells(clusters, subSamp = 25, seed = 5)

Arguments

clusters

vector of cluster labels (or any category) in factor or character format

subSamp

maximum number of values for each category to subsample. Can be single integer for global subsampling, or a *named* vector corresponding to how many values to take from each category in clusters.

seed

for reproducibility

Value

returns a vector of TRUE / FALSE with a maximum of subSamp TRUE calls per category