dim-odm-method: Return the number of columns and rows of an 'odm' object

dim,odm-methodR Documentation

Return the number of columns and rows of an odm object

Description

ncol() and nrow() return the number of rows (i.e., features) and columns (i.e., cells), respectively, contained within an odm object. dim() returns an integer vector of length two whose first and second entries, respectively, indicate the number of rows and columns in an odm object.

Usage

## S4 method for signature 'odm'
dim(x)

Arguments

x

an object of class odm

Value

the dimension of the odm object

Examples

library(sceptredata)
directories_to_load <- paste0(
 system.file("extdata", package = "sceptredata"),
 "/highmoi_example/gem_group_", c(1, 2)
)
directory_to_write <- tempdir()
out_list <- create_odm_from_cellranger(
  directories_to_load = directories_to_load,
  directory_to_write = directory_to_write,
)
gene_odm <- out_list$gene
# return the dimension, number of rows, and number of columns
dim(gene_odm)
nrow(gene_odm)
ncol(gene_odm)

timothy-barry/ondisc documentation built on April 14, 2024, 1:11 a.m.