Last chance! 50% off unlimited learning
Sale ends in
h5createDataset (file, dataset,
dims, maxdims = dims,
storage.mode = "double", H5type = NULL,
size = NULL, chunk = dims, level = 6,
fillValue, showWarnings=TRUE)
H5IdComponent
representing a H5 location identifier (file or group). See H5Fcreate
, H5Fopen
, H5Gcreate
, H5Gopen
to create an object of this kind.storage.mode(mydata)
.h5const("H5T")
for a list of available datatypes. If H5type
is specified the argument storage.mode
is ignored. It is recommended to use storage.mode
storage.mode='character'
the maximum string length has to be specified. HDF5 then stores the string as fixed length character vectors. Together with compression, this should be efficient.dims
. This argument is usually set together with a compression property (argument level
). h5createFile
, h5createGroup
, h5read
, h5write
, rhdf5
h5createFile("ex_createDataset.h5")
# create dataset with compression
h5createDataset("ex_createDataset.h5", "A", c(5,8), storage.mode = "integer", chunk=c(5,1), level=7)
# create dataset without compression
h5createDataset("ex_createDataset.h5", "B", c(5,8), storage.mode = "integer")
h5createDataset("ex_createDataset.h5", "C", c(5,8), storage.mode = "double")
# write data to dataset
h5write(matrix(1:40,nr=5,nc=8), file="ex_createDataset.h5", name="A")
# write second column
h5write(matrix(1:5,nr=5,nc=1), file="ex_createDataset.h5", name="B", index=list(NULL,2))
h5dump("ex_createDataset.h5")
Run the code above in your browser using DataLab