Skip to contents

dim() is c(n_obs, n_vars), dimnames() is list(obs_names, var_names) and length() is n_obs, like Python's len(). nrow() and ncol() follow from dim(). Comparison operators (==, !=, < and so on) are not supported and raise an anndata_not_implemented_error, as Python's __eq__ raises NotImplementedError, so compare the desired attributes instead.

Usage

# S3 method for class 'AnnData'
dim(x)

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

# S3 method for class 'AnnData'
length(x)

# S3 method for class 'AnnData'
Ops(e1, e2)

Arguments

x

An AnnData() object.

e1, e2

Operands of a comparison.

Value

dim() an integer vector of length 2, dimnames() a list of two character vectors and length() a single integer.

Examples

adata <- AnnData(matrix(as.numeric(1:6), nrow = 3))
dim(adata)
#> [1] 3 2
dimnames(adata)
#> [[1]]
#> [1] "0" "1" "2"
#> 
#> [[2]]
#> [1] "0" "1"
#> 
length(adata)
#> [1] 3