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(), orH5Dopen()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
h5objargument 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
attrshould be written into a scalar dataspace.- checkForNA
Whether a
attrshould be checked forNAvalues before being written. This only applies ofattris of type logical. Testing forNAvalues 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.