View source: R/HDF5Matrix_import.R
| hdf5_import_multiple | R Documentation |
Imports multiple files into the same HDF5 file, each as a separate dataset. Useful for batch importing related datasets.
hdf5_import_multiple(sources, filename, datasets, ...)
sources |
Character vector. Paths to files or URLs to import. |
filename |
Character. Path to HDF5 output file. |
datasets |
Character vector. Dataset paths for each source file.
Must be same length as |
... |
Additional arguments passed to |
Named list of HDF5Matrix objects, one for each imported file.
# Create temporary CSV files
f1 <- tempfile(fileext = ".csv")
f2 <- tempfile(fileext = ".csv")
f3 <- tempfile(fileext = ".csv")
hdf5_file <- tempfile(fileext = ".h5")
write.table(matrix(rnorm(20), 4, 5), f1, sep = ",",
row.names = FALSE, col.names = TRUE)
write.table(matrix(rnorm(20), 4, 5), f2, sep = ",",
row.names = FALSE, col.names = TRUE)
write.table(matrix(rnorm(20), 4, 5), f3, sep = ",",
row.names = FALSE, col.names = TRUE)
mats <- hdf5_import_multiple(
sources = c(f1, f2, f3),
filename = hdf5_file,
datasets = c("data/exp1", "data/exp2", "data/exp3"),
sep = ","
)
dim(mats$exp1)
hdf5_close_all()
unlink(c(f1, f2, f3, hdf5_file))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.