[[,VirtualArray,ANY,ANY-method {via} | R Documentation |
Indexing to extract the elements of a 'VirtualArray
'-derived class object.
Description
Double bracket '[['
refers to elements'/layers' name in the @stack
of the 'VirtualArray
'-derived object. Use single brackets to extract elements based on their position in the 'VirtualArray
'.
Usage
## S4 method for signature 'VirtualArray,ANY,ANY'
x[[i, drop = TRUE]]
Arguments
x |
|
i |
subscript of the first dimension(rows) or vector-like subsetting. |
drop |
|
Value
A VirtualArray
-derived class object, or an object of the class that makes up the VirtualArray
Examples
data(exemplar)
# finds a layer
exemplar[["sample1"]]
# returns a stack
exemplar[[c("sample1", "sample2")]]
# replaces a layervalues, but not the attributes of the layer
exemplar2 <- exemplar
exemplar2[["sample1"]] <- exemplar2[["sample2"]]
# compare every value in the they are all the same
exemplar2[["sample1"]]$x == exemplar2[["sample2"]]$x
[Package via version 0.2.0 Index]