
CommonFG
is the base class of H5File
and H5Group
and represents common functionality of these two classes. The CommonFG base
class supports various subsetting operators to easily access and manipulate
H5Group
and DataSet
objects
(see also CommonFG-Group
and CommonFG-DataSet
).h5close(.Object)## S3 method for class 'CommonFG,character,character,ANY':
[(x, i, j, ..., drop = TRUE)
## S3 method for class 'CommonFG,character,missing,missing':
[(x, i, j, ..., drop = TRUE)
## S3 method for class 'CommonFG,character,character':
[(x, i, j, ...) <- value
## S3 method for class 'CommonFG,missing,character,ANY':
[(x, i, j, ..., drop = TRUE)
## S3 method for class 'CommonFG,missing,character':
[(x, i, j, ...) <- value
CommonFG
;H5Group
DataSet
createDataSet
; only
relevant for assignment operator.CommonFG
objects represent a convenient way
to create/access H5Group
and DataSet
objects.
Currently, only character arguments are supported whereas the first argument
specifies the group to be created/accesses and the second the dataset name.Groups can be created/accessed by simply using one character parameter, e.g.
group <- obj["groupname"]
.
DataSets can be either accessed by using
dset <- obj["groupname", "datasetname"]
if existing or initialized by
using obj["groupname", "datasetname"] <- value
.
All created objects e.g. group
or dset
should be closed in the
end using h5close
.
CommonFG-Group
CommonFG-DataSet
H5Location-Attribute
file <- H5File("test.h5")
# Create new DataSet 'testset' in H5Group 'testgroup'
file["testgroup", "testset"] <- matrix(1:9, nrow = 3)
# Create new DataSet 'testset2' in file root
file[, "testset2"] <- 1:10
# Retrieve H5Group 'testgroup'
group <- file["testgroup"]
# Retrieve H5Group 'testset'
dset <- group[,"testset"]
h5close(dset)
h5close(group)
h5close(file)
file.remove("test.h5")
Run the code above in your browser using DataLab