CommonFG: The CommonFG Class

Description Usage Arguments Details See Also Examples

Description

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).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
h5close(.Object)

## S4 method for signature 'CommonFG,character,ANY'
x[i, j, ..., drop = TRUE]

## S4 replacement method for signature 'CommonFG,character,ANY'
x[i, j, ...] <- value

h5unlink(.Object, path)

## S4 method for signature 'CommonFG,character'
h5unlink(.Object, path)

Arguments

.Object

CommonFG; S4 object of class CommonFG;

x

CommonFG; object to be subsetted

i

character; Name of H5Group

j

character; Name of DataSet

...

Additional arguments passed to createDataSet; only relevant for assignment operator.

drop

logical; specify if class of result set should be dropped (not implemented yet).

value

vector/matrix/array; Value to be assigend to dataset

path

character; Path to be deleted, either specifying group or dataset.

Details

Subsetting operators on 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.

See Also

CommonFG-Group CommonFG-DataSet H5Location-Attribute

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 DataSet 'testset'
dset <- group["testset"]
h5close(dset)
h5close(group)
h5close(file)
file.remove("test.h5")

h5 documentation built on May 2, 2019, 3:45 a.m.