Learn R Programming

BigDataStatMeth (version 1.0.3)

bdRemove_hdf5_element: Remove Elements from HDF5 File

Description

Removes specified groups or datasets from an HDF5 file.

Usage

bdRemove_hdf5_element(filename, elements)

Value

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

Arguments

filename

Character string. Path to the HDF5 file.

elements

Character vector. Full paths to elements to remove (e.g., "group/dataset" or "group/subgroup").

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.

References

  • The HDF Group. (2000-2010). HDF5 User's Guide.

See Also

  • bdCreate_hdf5_matrix for creating HDF5 matrices

Examples

Run this code
if (FALSE) {
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)
}
}

Run the code above in your browser using DataLab