Description Usage Arguments Details Note Examples
DataSet
objects can be subsetted to retrieve or write sub–regions
as defined by a DataSpace
. The subsetting command should be
the same to base R subsetting of vectors, matrices or arrays. Also missing
subsetting parameters are supported.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## S4 method for signature 'DataSet,ANY,ANY'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'DataSet,missing,missing'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'DataSet,numeric,missing'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'DataSet,missing,numeric'
x[i, j, ..., drop = TRUE]
## S4 replacement method for signature 'DataSet,missing,missing'
x[i, j, ...] <- value
## S4 replacement method for signature 'DataSet,numeric,missing'
x[i, j, ...] <- value
## S4 replacement method for signature 'DataSet,missing,numeric'
x[i, j, ...] <- value
## S4 replacement method for signature 'DataSet,ANY,ANY'
x[i, j, ...] <- value
|
x |
DataSet; S4 object of class |
i |
integer; row index |
j |
integer; column index |
... |
additional arguments for subsetting |
drop |
logical; specify if |
value |
object; Value to be assigned to dataset |
For subset–write operations it has to be noted that no recycling is done by the function and therefore the written object needs to have the same dimensions as the subsetted region.
Subsetting DataSet
s can become slow for many selection
points since element–wise selection is used, see also DataSpace
.
1 2 3 4 5 6 7 8 9 10 | # Write submatrix to sub-region of DataSet
testmat_n <- matrix(as.integer(1:90), ncol = 9)
file <- h5file("test.h5", "a")
file["testgroup/testmat_n2"] <- testmat_n
submat <- matrix(-1L:-9L, nrow = 3)
dset2 <- file["testgroup/testmat_n2"]
dset2[c(1, 3, 5), c(1, 3, 5)] <- submat
h5close(dset2)
h5close(file)
file.remove("test.h5")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.