Execute Zonal Stats

execute_zonal(
  data = NULL,
  geom = NULL,
  w = NULL,
  ID = NULL,
  fun = "mean",
  subds = 0,
  progress = FALSE,
  join = TRUE,
  drop = NULL,
  ...
)

Arguments

data

SpatRaster or file path

geom

sf, sfc object with polygonal geometries

w

a weight grid (produced with weight_grid)

ID

the grouping ID

fun

an optional function or character vector, as described below

subds

character or boolean to select a sub-dataset. If NULL all are selected

progress

if TRUE, display a progress bar during processing

join

if TRUE the geom will be joined to the results

drop

colnames to drop from table

...

optional arguments to pass fun

Value

sf object or data.table