This function writes new data to an existing HDF5 file. If the dataset
already exists, it will be replaced with the new data.
Usage
write_hdf5_dataset(file_name, dataset_name, new_data)
Arguments
- file_name
A character string specifying the path to the HDF5 file.
- dataset_name
A character string specifying the name of the dataset
to be written in the HDF5 file.
- new_data
The new data to write to the dataset. The data must be
compatible with the dataset's structure.
Value
No return value; the function modifies the specified dataset in the
HDF5 file.
Examples
data_to_write <- 1:10
# Create an empty HDF5 file
hdf5_file <- tempfile()
create_hdf5_file(hdf5_file)
# Write new data to a dataset in the HDF5 file
write_hdf5_dataset(hdf5_file, "group/dataset", data_to_write)