bdgetDatasetsList_hdf5: List Datasets in HDF5 Group

View source: R/RcppExports.R

bdgetDatasetsList_hdf5R Documentation

List Datasets in HDF5 Group

Description

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

Usage

bdgetDatasetsList_hdf5(
  filename,
  group = NULL,
  prefix = NULL,
  recursive = FALSE
)

Arguments

filename

Character string. Path to the HDF5 file.

group

Character string or NULL. Group path within the HDF5 file. If NULL (default), the entire file is traversed recursively and dataset paths are returned relative to the root (e.g. "INPUT/A", "RESULTS/SVD/d").

prefix

Optional character string. Only return datasets whose name starts with this prefix.

recursive

Logical. If TRUE, recurse into subgroups and return full relative paths. Ignored when group = NULL (always recursive). Default FALSE.

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.

Value

Character vector containing dataset names.

References

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

Examples


fn <- tempfile(fileext = ".h5")
X  <- hdf5_create_matrix(fn, "INPUT/A",  data = matrix(rnorm(100), 10, 10))
Y  <- hdf5_create_matrix(fn, "INPUT/B",  data = matrix(rnorm(100), 10, 10))
Z  <- hdf5_create_matrix(fn, "RESULTS/C",data = matrix(rnorm(100), 10, 10))

# All datasets in the file (recursive from root)
bdgetDatasetsList_hdf5(fn)

# Only datasets in INPUT group
bdgetDatasetsList_hdf5(fn, group = "INPUT")

# INPUT group, recursive (same result here, no subgroups)
bdgetDatasetsList_hdf5(fn, group = "INPUT", recursive = TRUE)

# Filter by prefix
bdgetDatasetsList_hdf5(fn, group = "INPUT", prefix = "A")

hdf5_close_all()
unlink(fn)



BigDataStatMeth documentation built on May 15, 2026, 1:07 a.m.