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

An H5File, H5Group or a path name of HDF5 file.

name

Name of the new HDF5 dataset.

...

Arguments passed to H5File$create_dataset(). Also see [hdf5r:H5File-class]{H5File}.

dims

Dimensions of the new dataset.

dtype

The H5 datatype to use for the creation of the object. Must be an H5T. If set to NULL, it will be guessed through h5GuessDtype, according to storage.mode.

storage.mode

Object used to guess the HDF5 datatype. Default is numeric().

stype

'utf8' or 'ascii7'. Passed to h5GuessDtype.

maxdims

The maximal dimensions of the space. Default is dims.

chunk_size

Size of the chunk. Must have the same length as the dataset dimension. If NULL, no chunking is used. If set to "auto", the size of each chunk will be estimated according to maxdims and the byte size of dtype, using guess_chunks.

gzip_level

Enable zipping at the level given here. Only if chunk_dims is not NULL.

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)


[Package hdf5r.Extra version 0.0.6 Index]