subset,VirtualArray-method {via} | R Documentation |
Subset a 'VirtualArray
'-class object
Description
Extract subsets of an object from a class derived from 'VirtualArray
' similarly to a regular array.
Usage
## S4 method for signature 'VirtualArray'
subset(x, i, j, ..., oneDim = FALSE, drop = TRUE)
Arguments
x |
|
i |
subscript of the first dimension(rows) or vector-like subsetting. |
j |
subscript of the second dimension (columns). |
... |
subscript of additional dimensions. |
oneDim |
|
drop |
|
Value
Either the same class as x
, or the class that forms the element of the VirtualArray
.
Examples
ex <- rastex()
# first 4
subset(ex, i=1:4)
# missing at the end
subset(ex, i=1:12)
# character subscript
subset(ex, i=c("a", "b"))
# logical subscript
subs <- rep(TRUE, length(ex))
subs[1] <- FALSE # remove first
subset(ex, i= subs)
# no drop
subset(ex, i=1, drop=FALSE)
[Package via version 0.2.0 Index]