terra (version 1.0-10)

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

Description

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

Usage

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

Arguments

x

SpatRaster

value

SpatRaster

Value

SpatRaster

See Also

c

Examples

Run this code
# NOT RUN {
r <- rast(nrow=5, ncol=9, vals=1:45)
x <- c(r, r*2)
add(x) <- r*3
x
# }

Run the code above in your browser using DataCamp Workspace