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 filefn <-"test.hdf5"X <-matrix(rnorm(100), 10, 10)Y <-matrix(rnorm(100), 10, 10)# Save matrices to HDF5bdCreate_hdf5_matrix(fn, X, "data", "matrix1",overwriteFile =TRUE)bdCreate_hdf5_matrix(fn, Y, "data", "matrix2",overwriteFile =FALSE)# List all datasets in groupdatasets <-bdgetDatasetsList_hdf5(fn, "data")print(datasets)# List datasets with prefix "matrix"filtered <-bdgetDatasetsList_hdf5(fn, "data", prefix ="matrix")print(filtered)# Cleanupif (file.exists(fn)) {file.remove(fn)}
---title: "bdgetDatasetsList_hdf5"subtitle: "bdgetDatasetsList_hdf5"---<span class="category-badge hdf5_io_management">HDF5_IO_MANAGEMENT</span>## DescriptionRetrieves a list of all datasets within a specified HDF5 group, with optionalfiltering by prefix or suffix.## Usage```rbdgetDatasetsList_hdf5(filename, group, prefix =NULL)```## Arguments::: {.param-table}| 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. |:::## Value::: {.return-value}Character vector containing dataset names.:::## DetailsThis 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 filesThe function opens the HDF5 file in read-only mode to ensure data safety.## Examples```{r}#| eval: false#| code-fold: showlibrary(BigDataStatMeth)# Create a test HDF5 filefn <-"test.hdf5"X <-matrix(rnorm(100), 10, 10)Y <-matrix(rnorm(100), 10, 10)# Save matrices to HDF5bdCreate_hdf5_matrix(fn, X, "data", "matrix1",overwriteFile =TRUE)bdCreate_hdf5_matrix(fn, Y, "data", "matrix2",overwriteFile =FALSE)# List all datasets in groupdatasets <-bdgetDatasetsList_hdf5(fn, "data")print(datasets)# List datasets with prefix "matrix"filtered <-bdgetDatasetsList_hdf5(fn, "data", prefix ="matrix")print(filtered)# Cleanupif (file.exists(fn)) {file.remove(fn)}```## See Also::: {.see-also}- [bdCreate_hdf5_matrix](bdCreate_hdf5_matrix.html) for creating HDF5 matrices:::