h5CreateDataset {hdf5r.Extra} | R Documentation |
Create a new empty HDF5 dataset
Description
Create a new empty HDF5 dataset
Usage
h5CreateDataset(x, name, ...)
## S3 method for class 'H5Group'
h5CreateDataset(
x,
name,
dims,
dtype = NULL,
storage.mode = numeric(),
stype = c("utf8", "ascii7"),
maxdims = NULL,
chunk_size = "auto",
gzip_level = 6,
...
)
## S3 method for class 'H5File'
h5CreateDataset(
x,
name,
dims,
dtype = NULL,
storage.mode = numeric(),
stype = c("utf8", "ascii7"),
maxdims = NULL,
chunk_size = "auto",
gzip_level = 6,
...
)
## S3 method for class 'character'
h5CreateDataset(
x,
name,
dims,
dtype = NULL,
storage.mode = numeric(),
stype = c("utf8", "ascii7"),
maxdims = NULL,
overwrite = FALSE,
chunk_size = "auto",
gzip_level = 6,
...
)
Arguments
x |
|
name |
Name of the new HDF5 dataset. |
... |
Arguments passed to |
dims |
Dimensions of the new dataset. |
dtype |
The H5 datatype to use for the creation of the object. Must be
an |
storage.mode |
Object used to guess the HDF5 datatype. Default is
|
stype |
'utf8' or 'ascii7'. Passed to |
maxdims |
The maximal dimensions of the space. Default is |
chunk_size |
Size of the chunk. Must have the same length as the dataset
dimension. If |
gzip_level |
Enable zipping at the level given here. Only if chunk_dims
is not |
overwrite |
Whether or not to overwrite the existing HDF5 dataset. |
Value
This is an operation function and no return. Any failure should raise an error.
See Also
H5File
and H5Group
for the
$create_dataset()
methods.
Examples
tmp.file <- tempfile(fileext = ".h5")
h5CreateFile(tmp.file)
m <- matrix(0, 10, 5)
h5CreateDataset(tmp.file, "g1/m", dim(m))
m2 <- c("a", "b", "c")
h5CreateDataset(tmp.file, "g2/m2", length(m2), storage.mode = m2)