Last chance! 50% off unlimited learning
Sale ends in
setValues(x, values, layer)
values(x) <- value
RasterLayer
or RasterBrick
objectreplacement
r <- raster(ncol=10, nrow=10)
vals <- 1:ncell(r)
r <- setValues(r, vals)
# equivalent to
r[] <- vals
Run the code above in your browser using DataLab