
Reduction over named dims.
reduce_over.Rdop is a reduction name, not a function: the planner needs op
identity for algebraic decomposition and dtype rules. nan_rm = TRUE
(the default) skips nodata, matching R's na.rm = TRUE under the
NaN nodata sentinel.
Arguments
- x
A
LazyRaster, or aLazyDataset.- op
Reduction name: one of
"sum","mean","min","max","prod","median","quantile","sd","var","count","any","all". Alternatively a custom reducer: a functionfn(x, dims)written in theg_*vocabulary that collapses the marginsdims(e.g. a per-pixel model fit over time).- over
Names of dims to reduce over (subset of
names(dims)).- nan_rm
Skip NaN (nodata) values?
- bands
LazyDatasetonly: bands to reduce (default: all bands).
Details
Over a LazyDataset, each band is reduced independently (over "t": stack
the band's slices and collapse time to a composite); bands restricts which
bands. over = "band" collapses the band axis, returning a LazyRaster.
See also
geomedian() and medoid() for multivariate time
composites; band_project() and mlp_project() for band-axis
models; group_by_time() for calendar-grouped reduction;
scan_over() for order-preserving passes.