View source: R/Seurat.Utils.Metadata.R
sampleNpc | R Documentation |
This function samples a specified percentage of a dataframe (specifically a subset of the metadata of a Seurat object) and returns the corresponding cell IDs.
sampleNpc(metaDF = MetaData[which(Pass), ], pc = 0.1)
metaDF |
A dataframe representing a subset of the metadata of a Seurat object. Default: Subset of 'MetaData' for which 'Pass' is TRUE. |
pc |
The percentage of the dataframe to sample, expressed as a decimal. Default: 0.1. |
A vector of sampled cell IDs.
## Not run:
if (interactive()) {
# Example usage:
# Suppose 'MetaData' is a dataframe and 'Pass' is a boolean vector with the same length.
# The following example will sample 10% of the rows of 'MetaData' where 'Pass' is TRUE.
sampleNpc(metaDF = MetaData[which(Pass), ], pc = 0.1)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.