sub-odm-ANY-missing-missing-method: Load a row of an 'odm' object into memory

[,odm,ANY,missing,missing-methodR Documentation

Load a row of an odm object into memory

Description

The operator [ loads a specified row of an odm object into memory. The odm object can be indexed either by integer or feature ID.

Usage

## S4 method for signature 'odm,ANY,missing,missing'
x[i, j, drop]

Arguments

x

an object of class odm

i

the index of the row to load into memory. i can be either an integer (specifying the integer-based index of the row to load into memory) or a string (specifying the feature ID of the row to load into memory).

j

not used

drop

not used

Value

an expression vector (of class numeric)

Examples

directories_to_load <- file.path(
 system.file("extdata", "highmoi_example", package = "ondisc"),
 paste0("gem_group_", c(1, 2))
)
directory_to_write <- tempdir()
# Set data.table threads to 1 to pass CRAN example timing checks.
old_threads <- data.table::setDTthreads(1L)
out_list <- create_odm_from_cellranger(
  directories_to_load = directories_to_load,
  directory_to_write = directory_to_write,
)
data.table::setDTthreads(old_threads)
gene_odm <- out_list$gene
# extract rows into memory by index and ID
v1 <- gene_odm[10L,]
v2 <- gene_odm[rownames(gene_odm)[10],]

ondisc documentation built on June 17, 2026, 5:06 p.m.