Learn R Programming

SeuratObject (version 5.0.2)

dimnames.Assay: Assay-Level Feature and Cell Names

Description

Get and set feature and cell names in v5 Assays

Usage

# S3 method for Assay
dimnames(x)

# S3 method for Assay dimnames(x) <- value

Value

dimnames: A two-length list with the following values:

  • A character vector will all features in x

  • A character vector will all cells in x

dimnames<-: x with the cell names updated to those in value[[2L]]

Arguments

x

An Assay object

value

A two-length list where the first entry is the existing feature names for x and the second entry is the updated cell names for x

See Also

v3 Assay object, validity, and interaction methods: $.Assay(), Assay-class, Assay-validity, CreateAssayObject(), [.Assay(), [[.Assay(), dim.Assay(), merge.Assay(), split.Assay(), subset.Assay()

Cells(), dimnames.Assay5(), dimnames.Seurat()

Examples

Run this code
rna <- pbmc_small[["RNA"]]

# Feature and cell names can be acquired with `rownames` and `colnames`
head(rownames(rna))
head(colnames(rna))

# Cell names can be updated with `colnames<-`
colnames(rna)[1] <- "newcell"
head(colnames(rna))

Run the code above in your browser using DataLab