Learn R Programming

SeuratObject (version 5.0.2)

dim.DimReduc: Dimensional Reduction Meta-Information

Description

Pull meta-information about cells and dimensions for a given dimensional reduction; cell meta-information is stored as row meta-information (eg. nrow, rownames) and dimension meta-information is stored as column meta-information (eg. ncol, colnames)

Usage

# S3 method for DimReduc
dim(x)

# S3 method for DimReduc dimnames(x)

# S3 method for DimReduc length(x)

# S3 method for DimReduc names(x)

Value

dim: The number of cells (nrow) and dimensions (ncol)

dimnames: The cell (row) and dimension (column) names

length: The number of dimensions

names: The dimension identifiers

Arguments

x

A DimReduc object

See Also

Cells

Dimensional reduction object, validity, and interaction methods CreateDimReducObject(), DimReduc-class, DimReduc-validity, [.DimReduc(), [[.DimReduc(), merge.DimReduc(), print.DimReduc(), subset.DimReduc()

Examples

Run this code
pca <- pbmc_small[["pca"]]
pca
dim(pca)

# nrow is number of cells
nrow(pca)

# rownames pulls cell names
head(rownames(pca))

# ncol and length are number of dimensions
ncol(pca)
length(pca)

# colnames and names pull dimension identifiers
head(colnames(pca))
head(names(pca))

Run the code above in your browser using DataLab