if (FALSE) {
library(BigDataStatMeth)
# Create test data
data <- matrix(rnorm(1000), 100, 10)
# Save to HDF5
fn <- "test.hdf5"
bdCreate_hdf5_matrix(fn, data, "data", "matrix1",
overwriteFile = TRUE)
# Split by number of blocks
bdSplit_matrix_hdf5(
filename = fn,
group = "data",
dataset = "matrix1",
outgroup = "data_split",
outdataset = "block",
nblocks = 4,
bycols = TRUE
)
# Split by block size
bdSplit_matrix_hdf5(
filename = fn,
group = "data",
dataset = "matrix1",
outgroup = "data_split2",
outdataset = "block",
blocksize = 25,
bycols = TRUE
)
# Cleanup
if (file.exists(fn)) {
file.remove(fn)
}
}
Run the code above in your browser using DataLab