h5_writeAttribute: Write an R object as an HDF5 attribute

h5_writeAttributeR Documentation

Write an R object as an HDF5 attribute

Description

Write an R object as an HDF5 attribute

Usage

h5writeAttribute(
  attr,
  h5obj,
  name,
  h5loc,
  encoding = NULL,
  variableLengthString = FALSE,
  asScalar = FALSE,
  checkForNA = TRUE
)

## S3 method for class 'array'
h5writeAttribute(
  attr,
  h5obj,
  name,
  h5loc,
  encoding = NULL,
  variableLengthString = FALSE,
  asScalar = FALSE,
  checkForNA = TRUE
)

Arguments

attr

The R object to be written as an HDF5 attribute.

h5obj

Normally an object of class H5IdComponent representing a H5 object identifier (file, group, or dataset). See H5Fcreate, H5Fopen, H5Gcreate, H5Gopen, H5Dcreate, or H5Dopen to create an object of this kind. This argument can also be given the path to an HDF5 file.

name

The name of the attribute to be written.

h5loc

The location of the group or dataset within a file to which the attribute should be attached. This argument is only used if the h5obj argument is the path to an HDF5 file, otherwise it is ignored.

encoding

The encoding of the string data type. Valid options are "ASCII" and "UTF-8".

variableLengthString

Whether character vectors should be written as variable-length strings into the attributes.

asScalar

Whether length-1 attr should be written into a scalar dataspace.

checkForNA

Whether a attr should be checked for NA values before being written. This only applies of attr is of type logical. Testing for NA values can be slow if the object to be written is large, so if you are sure no such values will be present this argument can be used to disable the testing.


grimbough/rhdf5 documentation built on April 16, 2024, 8:22 p.m.