split.HDF5Matrix

split.HDF5Matrix

OTHER

1 Description

S3 method of base::split() for HDF5Matrix objects. Divides the matrix into blocks along rows (default) or columns.

Provide exactly ONE of n_blocks or block_size.

2 Usage

split.HDF5Matrix(...)

3 Arguments

Parameter Description
x An .
f Ignored (kept for S3 signature compatibility).
n_blocks Integer. Number of (roughly equal) blocks; -1 = unused.
block_size Integer. Max rows (or cols) per block; -1 = unused.
bycols Logical. If , split by columns (default = by rows).
out_group Character. HDF5 group for output blocks (default ).
out_dataset Character or NULL. Base dataset name.
overwrite Logical. Overwrite existing blocks (default ).
drop Ignored (S3 compatibility).

4 Value

Named list of objects: , , …

5 Examples

\donttest{

fn <- tempfile(fileext = ".h5")
X  <- hdf5_create_matrix(fn, "data/X", data = matrix(rnorm(2000000), 20000, 100))

X      <- hdf5_matrix( fn, "data/X")   # 20000 × 1000
blocks <- split(X, n_blocks = 4)             # 4 row-blocks of ~5000 rows each
}