Set a new dataset extension to an existing dataset in an HDF5 file
Arguments
- file
The filename (character) of the file in which the dataset will be located. For advanced programmers it is possible to provide an object of class H5IdComponent representing a H5 location identifier (file or group). See
H5Fcreate(),H5Fopen(),H5Gcreate(),H5Gopen()to create an object of this kind.- dataset
The name of the dataset in the HDF5 file, or an object of class H5IdComponent representing a H5 dataset identifier. See
H5Dcreate(), orH5Dopen()to create an object of this kind.- dims
The dimensions of the array as they will appear in the file. Note, the dimensions will appear in inverted order when viewing the file with a C program (e.g. HDFView), because the fastest changing dimension in R is the first one, whereas the fastest changing dimension in C is the last one.
- native
An object of class
logical. IfTRUE, array-like objects are treated as stored in HDF5 row-major rather than R column-major orientation. Usingnative = TRUEincreases HDF5 file portability between programming languages. A file written withnative = TRUEshould also be read withnative = TRUE
Examples
tmpfile <- tempfile()
h5createFile(file = tmpfile)
h5createDataset(tmpfile, "A", c(10, 12), c(20, 24))
h5ls(tmpfile, all = TRUE)[c("dim", "maxdim")]
#> dim maxdim
#> 0 10 x 12 20 x 24
h5set_extent(tmpfile, "A", c(20, 24))
h5ls(tmpfile, all = TRUE)[c("dim", "maxdim")]
#> dim maxdim
#> 0 20 x 24 20 x 24