dimnames.Assay: Assay-Level Feature and Cell Names

View source: R/assay.R

dimnames.AssayR Documentation

Assay-Level Feature and Cell Names

Description

Get and set feature and cell names in v5 Assays

Usage

## S3 method for class 'Assay'
dimnames(x)

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

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

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]]

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

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))


SeuratObject documentation built on May 29, 2024, 12:31 p.m.