[,VirtualArray,ANY,ANY-method {via} | R Documentation |
Indexing to extract subsets of a 'codeVirtualArray'-class object
Description
Single bracket '['
refers to indices and names within the 'VirtualArray
'-class object. Use double brackets to extract layers based on their names (in the @stack
).
Usage
## S4 method for signature 'VirtualArray,ANY,ANY'
x[i, j, ..., drop = TRUE]
Arguments
x |
An object from a |
i |
subscript of the first dimension(rows) or vector-like subsetting. |
j |
subscript of the second dimension (columns). |
... |
subscript of additional dimensions. |
drop |
|
Value
An object from either the same class as x
or the class of its elements.
Examples
ex <- rastex()
# numeric subsetting
firstThree <- ex[1:3]
# character subsetting
second <- ex["d"]
# logical subsetting
subscript <- rep(FALSE, length(ex))
subscript[2] <- TRUE
second2 <- ex[subscript]
data(paleocoastlines)
present<- paleocoastlines["0", ]
allMargin <- paleocoastlines[, "margin"]
[Package via version 0.2.0 Index]