getMetadataColumn: getMetadataColumn

View source: R/Seurat.Utils.Metadata.R

getMetadataColumnR Documentation

getMetadataColumn

Description

Retrieves a specified metadata column from a Seurat object and returns it as a named vector.

Usage

getMetadataColumn(col = "batch", obj = combined.obj, as_numeric = FALSE)

Arguments

col

A string specifying the name of the metadata column to be retrieved. Default: 'batch'.

obj

A Seurat object from which the metadata column will be retrieved. Default: combined.obj.

as_numeric

A logical flag indicating whether the returned values should be converted to numeric format. Default: FALSE. (FALSE).

Value

A named vector containing the values from the specified metadata column. If 'as_numeric' is TRUE, the values are converted to numeric format.

Examples

## Not run: 
if (interactive()) {
  # Example usage:
  batch_metadata <- getMetadataColumn(col = "batch", obj = combined.obj, as_numeric = TRUE)
}

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.