rowSums | R Documentation |
Sum or average values of SpatRaster layers by row or column.
## S4 method for signature 'SpatRaster'
rowSums(x, na.rm=FALSE, dims=1L, ...)
## S4 method for signature 'SpatRaster'
colSums(x, na.rm=FALSE, dims=1L, ...)
## S4 method for signature 'SpatRaster'
rowMeans(x, na.rm=FALSE, dims=1L, ...)
## S4 method for signature 'SpatRaster'
colMeans(x, na.rm=FALSE, dims=1L, ...)
x |
SpatRaster |
na.rm |
logical. If |
dims |
this argument is ignored |
... |
additional arguments (none implemented) |
matrix
See global
for summing all cells values
r <- rast(ncols=2, nrows=5, nl=2, vals=1:20)
rowSums(r)
colSums(r)
colMeans(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.