Ensure that an HDF5 dataset exists (create if missing)
Source:R/h5_ensure_dataset.R
h5_ensure_dataset.RdCreates missing groups along the path and then creates the dataset. Designed for RAINDROP input files where missing scalar parameters can crash the model definition reader.
Arguments
- h5
Open
hdf5r::H5File(mode "a" or "r+").- path
Absolute dataset path (e.g. "/Berechnungsparameter/Zeitschritt_Verschaltungen").
- value
Initial value to write after creation (scalar, vector, matrix, or 2-col TS).
- dtype
Optional. Either an
H5Tobject or a string ("double","integer","logical","character"). If NULL, inferred fromvalue.- dims
Optional integer vector. If NULL, inferred from
value.