Replace a layer of a SpatRaster, or an attribute variable of a SpatVector
Usage
# S4 method for SpatRaster
$(x, name) <- value
# S4 method for SpatVector
$(x, name)<-value
# S4 method for SpatExtent
$(x, name) <- value
Value
Same as x
Arguments
x
SpatRaster, SpatVector or SpatExtent
name
character. If x is a SpatRaster: layer name. If x is a SpatVector: variable name. If x is a SpatExtent: "xmin", "xmax". "ymin" or "ymax"
value
if x is a SpatRaster, a SpatRaster for which this TRUE: nlyr(value) == length(i); if x is a SpatVector, a vector of new values; if x is a SpatExtent a single number