# 'meta' is a data frame with columns 'label' and 'batch'
meta <- data.frame(
label = c(rep("A", 40), rep("A", 35), rep("B", 20)),
batch = c(rep("X", 40), rep("Y", 35), rep("X", 20))
)
keep_cells <- downsampling(meta, n.size = 35, seed = 12345)
# Display the selected indices
print(keep_cells)
Run the code above in your browser using DataLab