View source: R/S3_operations.R
| split.HDF5Matrix | R Documentation |
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.
## S3 method for class 'HDF5Matrix'
split(
x,
f = NULL,
drop = FALSE,
n_blocks = -1L,
block_size = -1L,
bycols = FALSE,
out_group = "SPLIT",
out_dataset = NULL,
overwrite = FALSE,
...
)
x |
An |
f |
Ignored (kept for S3 signature compatibility). |
drop |
Ignored (S3 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 |
out_group |
Character. HDF5 group for output blocks (default |
out_dataset |
Character or NULL. Base dataset name. |
overwrite |
Logical. Overwrite existing blocks (default |
... |
Ignored. |
Named list of HDF5Matrix objects:
block_0, block_1, …
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.