-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
\name{rowSums} | ||
|
||
\docType{methods} | ||
|
||
\alias{rowSums} | ||
\alias{rowSums,Raster-method} | ||
\alias{colSums} | ||
\alias{colSums,Raster-method} | ||
\alias{rowMeans} | ||
\alias{rowMeans,Raster-method} | ||
\alias{colMeans} | ||
\alias{colMeans,Raster-method} | ||
|
||
\title{row/col sums and means for SpatRaster} | ||
|
||
\description{ | ||
Sum or average values of SpatRaster layers by row or column. | ||
} | ||
|
||
\usage{ | ||
\S4method{rowSums}{SpatRaster}(x, na.rm=FALSE, dims=1L, ...) | ||
\S4method{colSums}{SpatRaster}(x, na.rm=FALSE, dims=1L, ...) | ||
\S4method{rowMeans}{SpatRaster}(x, na.rm=FALSE, dims=1L, ...) | ||
\S4method{colMeans}{SpatRaster}(x, na.rm=FALSE, dims=1L, ...) | ||
} | ||
|
||
\arguments{ | ||
\item{x}{SpatRaster} | ||
\item{na.rm}{logical. If \code{TRUE}, \code{NA} values are ignored} | ||
\item{dims}{this argument is ignored} | ||
\item{...}{additional arguments (none implemented)} | ||
} | ||
|
||
\value{ | ||
matrix | ||
} | ||
|
||
\seealso{ | ||
See \code{\link{global}} for summing all cells values | ||
} | ||
|
||
\examples{ | ||
r <- rast(ncols=2, nrows=5, nl=2, vals=1:20) | ||
rowSums(r) | ||
colSums(r) | ||
} | ||
|
||
\keyword{spatial} | ||
|