replacementSingle: Replace layers of a 'RasterArray' or 'SpatialArray' object

Description Usage Arguments Value Examples

Description

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 RasterArrays. Spatial* objects and SpatialArrays can be used with SpatialArrays.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## 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

Arguments

x

RasterArray or SpatialArray object.

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 x.

Value

None.

Examples

1
2
3
4
5
data(dems)
# replace third element with missing value
dems[3] <- NA
# duplicate first element and make it the second too
dems[2] <-dems[1]

chronosphere documentation built on April 19, 2021, 1:07 a.m.