rowSums

0th

Percentile

rowSums and colSums for Raster objects

Sum values of Raster objects by row or column.

Keywords
spatial
Usage
# S4 method for Raster
rowSums(x, na.rm=FALSE, dims=1L,...) 
# S4 method for Raster
colSums(x, na.rm=FALSE, dims=1L,...)
Arguments
x

Raster* object

na.rm

logical. If TRUE, NA values are ignored

dims

this argument is ignored

...

additional arguments (none implemented)

Value

vector (if x is a RasterLayer) or matrix

See Also

See cellStats for summing all cells values

Aliases
  • rowSums
  • rowSums,Raster-method
  • colSums
  • colSums,Raster-method
Examples
# NOT RUN {
r <- raster(ncols=2, nrows=5)
values(r) <- 1:10
as.matrix(r)
rowSums(r)
colSums(r)
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.