H5Screate (type = h5default("H5S"))
H5Screate_simple (dims, maxdims )
H5Scopy (h5space)
H5Sclose (h5space)
H5Sis_simple (h5space)
H5Sget_simple_extent_dims (h5space)
H5Sset_extent_simple (h5space, dims, maxdims)
H5Sselect_hyperslab (h5space, op = h5default("H5S_SELECT"),
start = NULL, stride = NULL, count = NULL, block = NULL)
H5Sselect_index (h5space, index)
h5const("H5S")
for possible types.H5IdComponent
representing a H5 dataspace identifier. See H5Dget_space
, H5Screate_simple
, H5Screate
to create an object of this kind.H5Screate
, H5Screate_simple
, and H5Scopy
return an object of class H5IdComponent
representing a dataspace.H5Sis_simple
returns a boolean.H5Sget_simple_extent_dims
returns an integer vector.The other functions return the standard return value from their respective C-functions.
As an introduction to use hyperslabs see these tutorials: See these introductions to hyperslabs: http://www.hdfgroup.org/HDF5/Tutor/selectsimple.html, http://www.hdfgroup.org/HDF5/Tutor/select.html and http://ftp.hdfgroup.org/HDF5/Tutor/phypecont.html. Please note that in R the first dimension is the fastest changing dimension. When viewing the HDF5 datasets with any C-program (e.g. HDFView), the order of dimensions is inverted. In the R interface counting starts with 1, whereas in the C-programs (e.g. HDFView) counting starts with 0.
H5Sselect_index
is not part of the standard HDF5 C interface. It performes an iterative call to H5select_points by iterating through the given index positions. This function avoids a for loop in R. If a list element is NULL, all elements of the respective dimension are considered.
sid <- H5Screate_simple(c(10,5,3))
sid
H5Sis_simple(sid)
H5Sget_simple_extent_dims(sid)
# select a subarray (called hyperslab in the hdf5 community).
# The next h5write can use this to write a subarray
H5Sselect_index(sid, list(1:3,2:4,2))
# always close dataspaces after usage to free recources
H5Sclose(sid)
sid
Run the code above in your browser using DataLab