bdRemove_hdf5_element

bdRemove_hdf5_element

HDF5_IO_MANAGEMENT

1 Description

Removes specified groups or datasets from an HDF5 file.

2 Usage

bdRemove_hdf5_element(filename, elements)

3 Arguments

Parameter Description
filename Character string. Path to the HDF5 file.
elements Character vector. Full paths to elements to remove (e.g., “group/dataset” or “group/subgroup”).

4 Value

No return value, called for side effects (element removal).

5 Details

This function provides safe element removal capabilities with: - Removal options: - Single element removal - Multiple element removal - Groups and datasets removal - Implementation features: - Safe file operations - Memory-efficient implementation - Comprehensive error handling - Path validation

The function validates paths and performs safe removal operations.

6 Examples

Code
library(BigDataStatMeth)

# Create test matrices
matA <- matrix(1:15, nrow = 3, byrow = TRUE)
matB <- matrix(15:1, nrow = 3, byrow = TRUE)

# Save to HDF5
fn <- "test.hdf5"
bdCreate_hdf5_matrix(fn, matA, "data", "matrix1",
                     overwriteFile = TRUE)
bdCreate_hdf5_matrix(fn, matB, "data", "matrix2",
                     overwriteFile = FALSE)

# Remove elements
bdRemove_hdf5_element(fn, c("data/matrix1", "data/matrix2"))

# Cleanup
if (file.exists(fn)) {
  file.remove(fn)
}

7 See Also