| $.Seurat {SeuratObject} | R Documentation |
Cell-Level Meta Data
Description
Get and set cell-level meta data
Usage
## S3 method for class 'Seurat'
x$i
## S3 replacement method for class 'Seurat'
x$i, ... <- value
## S4 replacement method for signature 'Seurat,character,missing,data.frame'
x[[i, j, ...]] <- value
## S4 replacement method for signature 'Seurat,missing,missing,data.frame'
x[[i, j, ...]] <- value
## S4 replacement method for signature 'Seurat,character,missing,factor'
x[[i, j, ...]] <- value
## S4 replacement method for signature 'Seurat,character,missing,list'
x[[i, j, ...]] <- value
## S4 replacement method for signature 'Seurat,missing,missing,list'
x[[i, j, ...]] <- value
## S4 replacement method for signature 'Seurat,character,missing,vector'
x[[i, j, ...]] <- value
Arguments
x |
A |
i |
Name of cell-level meta data |
... |
Ignored |
value |
A vector to add as cell-level meta data |
j |
Ignored |
Value
$: Metadata column i for object x;
note: unlike [[, $ drops the shape of the metadata
to return a vector instead of a data frame
$<-: x with metadata value saved as i
See Also
Seurat object, validity, and interaction methods
Seurat-class,
Seurat-validity,
[[.Seurat(),
[[<-,Seurat,
[[<-,Seurat,NULL,
dim.Seurat(),
dimnames.Seurat(),
merge.Seurat(),
names.Seurat(),
subset.Seurat()
Examples
# Get metadata using `$'
head(pbmc_small$groups)
# Add metadata using the `$' operator
set.seed(42)
pbmc_small$value <- sample(1:3, size = ncol(pbmc_small), replace = TRUE)
head(pbmc_small[["value"]])
[Package SeuratObject version 5.0.2 Index]