rowSums | R Documentation |
Sum values of Raster objects by row or column.
## S4 method for signature 'Raster'
rowSums(x, na.rm=FALSE, dims=1L,...)
## S4 method for signature 'Raster'
colSums(x, na.rm=FALSE, dims=1L,...)
x |
Raster* object |
na.rm |
logical. If |
dims |
this argument is ignored |
... |
additional arguments (none implemented) |
vector (if x
is a RasterLayer) or matrix
See cellStats
for summing all cells values
r <- raster(ncols=2, nrows=5)
values(r) <- 1:10
as.matrix(r)
rowSums(r)
colSums(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.