hdf5_reduce

hdf5_reduce

AGGREGATIONS

1 Description

Applies a binary reduction ("+" or "-") across all datasets stored in a given HDF5 group and writes the result as a new dataset. Delegates to bdReduce_hdf5_dataset().

2 Usage

hdf5_reduce(...)

3 Arguments

Parameter Description
filename Path to the HDF5 file.
group Group path containing the datasets to reduce.
func Character. Reduction operator: (default) or .
outgroup Character or . Output group (default: same as ).
outdataset Character or . Output dataset name (default: same as ).
overwrite Logical. Overwrite existing output dataset.
remove Logical. Remove input datasets after reduction.

4 Value

An pointing to the result dataset.

5 Examples

\donttest{
fn <- tempfile(fileext = ".h5")
hdf5_create_matrix(fn, "blocks/A", data = matrix(1:6, 2, 3))
hdf5_create_matrix(fn, "blocks/B", data = matrix(1:6, 2, 3))
hdf5_create_matrix(fn, "blocks/C", data = matrix(1:6, 2, 3))
result <- hdf5_reduce(fn, group = "blocks", func = "+")
as.matrix(result)
hdf5_close_all()
unlink(fn)
}

6 See Also