bdgetDatasetsList_hdf5

bdgetDatasetsList_hdf5

HDF5_IO_MANAGEMENT

1 Description

Retrieves a list of all datasets within a specified HDF5 group, with optional filtering by prefix or suffix.

2 Usage

bdgetDatasetsList_hdf5(filename, group, prefix = NULL)

3 Arguments

Parameter Description
filename Character string. Path to the HDF5 file.
group Character string. Path to the group within the HDF5 file.
prefix Optional character string. If provided, only returns datasets starting with this prefix.

4 Value

Character vector containing dataset names.

5 Details

This function provides flexible dataset listing capabilities for HDF5 files. Key features: - Listing options: - All datasets in a group - Datasets matching a prefix - Datasets matching a suffix - Implementation features: - Safe HDF5 file operations - Memory-efficient implementation - Comprehensive error handling - Read-only access to files

The function opens the HDF5 file in read-only mode to ensure data safety.

6 Examples

Code
library(BigDataStatMeth)

# Create a test HDF5 file
fn <- "test.hdf5"
X <- matrix(rnorm(100), 10, 10)
Y <- matrix(rnorm(100), 10, 10)

# Save matrices to HDF5
bdCreate_hdf5_matrix(fn, X, "data", "matrix1",
                     overwriteFile = TRUE)
bdCreate_hdf5_matrix(fn, Y, "data", "matrix2",
                     overwriteFile = FALSE)

# List all datasets in group
datasets <- bdgetDatasetsList_hdf5(fn, "data")
print(datasets)

# List datasets with prefix "matrix"
filtered <- bdgetDatasetsList_hdf5(fn, "data", prefix = "matrix")
print(filtered)

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

7 See Also