Replace layers of a RasterArray or SpatialArray object
Single bracket '['
refers to indices and names within the \codeRasterArray or SpatialArray
. Use double brackets to replace layers based on their names (in the stack).
RasterLayers
and RasterArray
entries can be used to replace values in RasterArray
s. Spatial*
objects and SpatialArray
s can be used with SpatialArray
s.
## S4 replacement method for signature 'XArray,ANY,ANY,logical' x[i, j, ...] <- value ## S4 replacement method for signature 'RasterArray,ANY,ANY,RasterLayer' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialPoints' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialPointsDataFrame' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialLines' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialLinesDataFrame' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialPolygons' x[i, j, ...] <- value ## S4 replacement method for signature 'SpatialArray,ANY,ANY,SpatialPolygonsDataFrame' x[i, j, ...] <- value
x |
|
i |
subscript of the first dimension(rows) or vector-like subsetting. |
j |
subscript of the second dimension (columns). |
... |
subscript of additional dimensions. |
value |
A same class object as |
None.
data(dems) # replace third element with missing value dems[3] <- NA # duplicate first element and make it the second too dems[2] <-dems[1]
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.