| bdReduce_hdf5_dataset | R Documentation |
Reduces multiple datasets within an HDF5 group using arithmetic operations (addition or subtraction).
bdReduce_hdf5_dataset(
filename,
group,
reducefunction,
outgroup = NULL,
outdataset = NULL,
overwrite = FALSE,
remove = FALSE
)
filename |
Character string. Path to the HDF5 file. |
group |
Character string. Path to the group containing datasets. |
reducefunction |
Character. Operation to apply, either "+" or "-". |
outgroup |
Character string (optional). Output group path. If NULL, uses input group. |
outdataset |
Character string (optional). Output dataset name. If NULL, uses input group name. |
overwrite |
Logical (optional). Whether to overwrite existing dataset. Default is FALSE. |
remove |
Logical (optional). Whether to remove source datasets after reduction. Default is FALSE. |
This function provides efficient dataset reduction capabilities with:
Operation options:
Addition of datasets
Subtraction of datasets
Output options:
Custom output location
Configurable dataset name
Overwrite protection
Implementation features:
Memory-efficient processing
Safe file operations
Optional source cleanup
Comprehensive error handling
The function processes datasets efficiently while maintaining data integrity.
List with components. If an error occurs, all string values are returned as empty strings (""):
Character string with the HDF5 filename
Character string with the full dataset path to the reduced dataset (group/dataset)
Character string with the reduction function applied
The HDF Group. (2000-2010). HDF5 User's Guide.
fn <- tempfile(fileext = ".h5")
hdf5_create_matrix(fn, "data/matrix1", data = matrix(1:100, 10, 10))
hdf5_create_matrix(fn, "data/matrix2", data = matrix(101:200, 10, 10))
hdf5_create_matrix(fn, "data/matrix3", data = matrix(201:300, 10, 10))
bdReduce_hdf5_dataset(
filename = fn,
group = "data",
reducefunction = "+",
outgroup = "results",
outdataset = "sum_matrix",
overwrite = TRUE
)
hdf5_close_all()
unlink(fn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.