aggregateSpatial.uncompiled: Spatially aggregate a Field

View source: R/aggregateSpatial.R

aggregateSpatial.uncompiledR Documentation

Spatially aggregate a Field

Description

Spatially aggragte all gridcells of a Field (or a data.table assuming it has columns "Lon" and "Lat"). Can use area-weighting to take into account the different areas of gridcells (even though they are constant in Lon, Lat)

Usage

aggregateSpatial.uncompiled(x, method = "mean", verbose = FALSE, ...)

Arguments

x

Field (or data.table) to be averaged

method

The method with which to spatially aggregate. Can be "weighted.mean", "w.mean", "mean", "weighted.sum", "w.sum", "sum", "mode", "median", "max", "min", "sd", "var" and "cv" (= coefficient of variation: sd/mean).

verbose

If TRUE give some progress update about the averaging.

...

Extra arguments passed to addArea function if a weighted method is being used. Note in particular the lon_centres and lat_centres arguments if you are using a regular but sparsely populated grid.

Value

A Field or data.table depending on the input object

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.