Read and Create Attributes for H5Location Objects

Description

H5Location is the base class of H5File, H5Group and DataSet and implements common methods to create and access attributes for inherited classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
createAttribute(.Object, attributename, data, size = -1)

## S4 method for signature 'H5Location,character'
createAttribute(.Object, attributename, data,
  size = -1)

openAttribute(.Object, attributename)

## S4 method for signature 'H5Location,character'
openAttribute(.Object, attributename)

h5attr(.Object, attributename)

## S4 method for signature 'H5Location,character'
h5attr(.Object, attributename)

h5attr(.Object, attributename, ...) <- value

## S4 replacement method for signature 'H5Location,character'
h5attr(.Object, attributename, ...) <- value

list.attributes(.Object)

## S4 method for signature 'H5Location'
list.attributes(.Object)

Arguments

.Object

H5Location; S4 object of class H5Location;

attributename

character; Name of attribute to be read/created.

data

object; Data object to be used for attribute creation, can be either of type vector, matrix or array.

size

numeric; Character length for fixed-length string data types. Default value of -1 creates variable-length strings.

...

Additional parameters passed to createAttribute.

value

object; Object to be stored in HDF5 Attribute, can be either of type vector, matrix or array.

See Also

Attribute H5File H5Group DataSet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Write Attributes for H5File, H5Group and DataSet
file <- h5file("test.h5")
h5attr(file, "fileattrib") <- 1:10
group <- file["testgroup"]
h5attr(group, "groupattrib") <- matrix(1:9, nrow = 3)
h5attr(group, "groupattrib")
group["testdataset"] <- 1:10
dset <- group["testdataset"]
h5attr(dset, "dsetattrib") <- LETTERS[1:10]
h5close(dset)
h5close(group)
h5close(file)
file.remove("test.h5")