Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Nov 11, 2023
1 parent 83ef6f9 commit 835b43c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/zonal.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ setMethod("zonal", signature(x="SpatRaster", z="SpatRaster"),


setMethod("zonal", signature(x="SpatRaster", z="SpatVector"),
function(x, z, fun="mean", na.rm=FALSE, w=NULL, weights=FALSE, exact=FALSE, touches=FALSE, as.raster=FALSE, as.polygons=FALSE, wide=FALSE, filename="", wopt=list()) {
function(x, z, fun="mean", na.rm=FALSE, w=NULL, weights=FALSE, exact=FALSE, touches=FALSE, as.raster=FALSE, as.polygons=FALSE, wide=TRUE, filename="", wopt=list()) {
opt <- spatOptions()
txtfun <- .makeTextFun(fun)
if (!inherits(txtfun, "character")) {
Expand Down
7 changes: 4 additions & 3 deletions man/time.Rd
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
\name{time}

\alias{time}
\alias{time,SpatRaster-method}
\alias{time,SpatRasterDataset-method}
\alias{has.time}
\alias{has.time,SpatRaster-method}
\alias{has.time,SpatRasterDataset-method}
\alias{time<-}
\alias{time<-,SpatRaster-method}
\alias{time<-,SpatRasterDataset-method}
\alias{has.time,SpatRasterDataset-method}
\alias{time,SpatRaster-method}
\alias{time,SpatRasterDataset-method}
\alias{timeInfo}
\alias{timeInfo,SpatRaster-method}
\alias{timeInfo,SpatRasterDataset-method}
Expand Down
4 changes: 2 additions & 2 deletions man/zonal.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can also summarize values of a SpatVector for each polygon (zone) defined by
as.raster=FALSE, filename="", overwrite=FALSE, wopt=list())

\S4method{zonal}{SpatRaster,SpatVector}(x, z, fun="mean", na.rm=FALSE, w=NULL, weights=FALSE,
exact=FALSE, touches=FALSE, as.raster=FALSE, as.vector=FALSE, wide=TRUE,
exact=FALSE, touches=FALSE, as.raster=FALSE, as.polygons=FALSE, wide=TRUE,
filename="", wopt=list())

\S4method{zonal}{SpatVector,SpatVector}(x, z, fun=mean, ..., weighted=FALSE, as.polygons=FALSE)
Expand All @@ -44,7 +44,7 @@ You can also summarize values of a SpatVector for each polygon (zone) defined by
\item{touches}{logical. If \code{TRUE}, values for all cells touched by lines or polygons are extracted, not just those on the line render path, or whose center point is within the polygon. Not relevant for points; and always considered \code{TRUE} when \code{weights=TRUE} or \code{exact=TRUE}}

\item{weighted}{logical. If \code{TRUE}, a weighted.mean is computed and \code{fun} is ignored. Weights are based on the length of the lines or the area of the polygons in \code{x} that intersect with \code{z}. This argument is ignored of \code{x} is a SpatVector or points}
\item{as.polygons}{logical. Should the results be merged with the attributes of \code{z}?}
\item{as.polygons}{logical. Should the zonal statistics be combined with the geometry of \code{z}?}
\item{na.rm}{logical. If \code{TRUE}, \code{NA}s are removed}
}

Expand Down

0 comments on commit 835b43c

Please sign in to comment.