Last chance! 50% off unlimited learning
Sale ends in
H5Dcreate (h5loc, name, dtype_id, h5space, lcpl=NULL, dcpl=NULL, dapl=NULL)
H5Dopen (h5loc, name, dapl=NULL)
H5Dclose (h5dataset)
H5Dget_space (h5dataset)
H5Dget_type (h5dataset)
H5Dget_create_plist (h5dataset)
H5Dget_storage_size (h5dataset)
H5Dread (h5dataset, h5spaceFile = NULL, h5spaceMem = NULL, buf = NULL, compoundAsDataFrame = TRUE, bit64conversion)
H5Dwrite (h5dataset, buf, h5spaceMem = NULL, h5spaceFile = NULL)
H5Dset_extent (h5dataset, size)
H5IdComponent
representing a H5 location identifier (file or group). See H5Fcreate
, H5Fopen
, H5Gcreate
, H5Gopen
to create an object of this kind.h5const("H5T")
for possible datatypes. Can also be an integer representing an HDF5 datatype.H5IdComponent
representing a H5 dataspace. See H5Dget_space
, H5Screate_simple
, H5Screate
to create an object of this kind.H5IdComponent
representing a H5 dataset. See H5Dcreate
, H5Dopen
to create an object of this kind.H5IdComponent
representing a H5 dataspace. See H5Dget_space
, H5Screate_simple
, H5Screate
to create an object of this kind. The dimensions of the dataset in the file and in memory. The dimensions in file and in memory are interpreted in an R-like manner. The first dimension is the fastest changing dimension. When reading the file with a C-program (e.g. HDFView) the order of dimensions will invert, because in C the fastest changing dimension is the last one.h5spaceMem
. No extra memory will be allocated for the data. A pointer to the same data is returned.H5IdComponent
representing a H5 link creation property list. See H5Pcreate
, H5Pcopy
to create an object of this kind.H5IdComponent
representing a H5 dataset creation property list. See H5Pcreate
, H5Pcopy
to create an object of this kind.H5IdComponent
representing a H5 dataset access property list. See H5Pcreate
, H5Pcopy
to create an object of this kind.H5Dcreate
and H5Dopen
return an object of class H5IdComponent
represinting a H5 dataset identifier.H5Dget_space
returns an object of class H5IdComponent
representing a H5 dataspace identifier.H5Dread
returns an array with the read data.The other functions return the standard return value from their respective C-functions.
# write a dataset
fid <- H5Fcreate("ex_H5D.h5")
fid
sid <- H5Screate_simple(c(10,5,3))
sid
did <- H5Dcreate(fid, "A", "H5T_STD_I32LE", sid)
did
H5Dwrite(did, 1L:150L, h5spaceMem = sid, h5spaceFile = sid)
H5Dclose(did)
H5Sclose(sid)
H5Fclose(fid)
# read a dataset
fid <- H5Fopen("ex_H5D.h5")
fid
did <- H5Dopen(fid, "A")
did
sid <- H5Dget_space(did)
sid
B <- H5Dread(did)
B
H5Dclose(did)
H5Sclose(sid)
H5Fclose(fid)
# write a subarray
fid <- H5Fopen("ex_H5D.h5")
fid
did <- H5Dopen(fid, "A")
did
sid <- H5Dget_space(did)
sid
H5Sselect_index(sid, list(1:3,2:4,2))
sidmem <- H5Screate_simple(c(3,3,1))
sidmem
A = array(-801:-809,dim=c(3,3,1))
H5Dwrite(did, A, h5spaceMem = sidmem, h5spaceFile = sid)
H5Dread(did)
H5Sclose(sid)
H5Dclose(did)
H5Sclose(sidmem)
H5Fclose(fid)
Run the code above in your browser using DataLab