View source: R/aggregate_raster.R
aggregate_raster | R Documentation |
Aggregate raster cells (and optionally layers) to coarser resolution.
aggregate_raster( rast, outfile, aggregate_factor, fun = sum, return_rast = FALSE )
rast |
Raster* object or file path to a raster file. |
outfile |
Character. Output raster file path. If not provided, object will be returned to R. Directory will be created recursively if it does not exist. |
aggregate_factor |
Integer. Aggregation factor expressed as number of cells in each direction (horizontally and vertically). Or a vector of two integers (horizontal and vertical aggregation factors) or three integers (when also aggregating over layers). |
fun |
Function. Function used to aggregate values. Default is
|
return_rast |
Logical. Should the resulting raster be returned to R?
Ignored if |
If outfile
is specified, the resulting raster is saved as a
geotiff to that path. If return_rast
is TRUE
or
outfile
is not specified the resulting raster is returned,
otherwise NULL
is returned invisibly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.