subset,VirtualArray-method | R Documentation |
VirtualArray
'-class objectExtract subsets of an object from a class derived from 'VirtualArray
' similarly to a regular array.
## S4 method for signature 'VirtualArray'
subset(x, i, j, ..., oneDim = FALSE, drop = TRUE)
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 |
|
Either the same class as x
, or the class that forms the element of the VirtualArray
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.