add: Add (in place) a SpatRaster to another SpatRaster object or...

addR Documentation

Add (in place) a SpatRaster to another SpatRaster object or to a SpatRasterDataset or SpatRasterCollection

Description

Add (in place) a SpatRaster to another SpatRaster object. Comparable with c, but without copying the object.

Usage

## S4 replacement method for signature 'SpatRaster,SpatRaster'
add(x)<-value

## S4 replacement method for signature 'SpatRasterDataset,SpatRaster'
add(x)<-value

## S4 replacement method for signature 'SpatRasterCollection,SpatRaster'
add(x)<-value

Arguments

x

SpatRaster, SpatRasterDataset or SpatRasterCollection

value

SpatRaster

Value

SpatRaster

See Also

c

Examples

r <- rast(nrows=5, ncols=9, vals=1:45)
x <- c(r, r*2)
add(x) <- r*3
x

terra documentation built on Oct. 13, 2023, 5:08 p.m.