Description Usage Arguments Value Examples
Perform raster zonal statistics from a vector zone layer and add the results to the attribute layer of the vector layer.
1 | zonal_pipe(r, z, stats, filename = NULL)
|
r |
A raster file for which one wishes to compute zonal statistics |
z |
A vector layer (e.g. a shapefile) containing one polygon for each zone used to derive zonal statics (e.g. admnistrative areas) |
stats |
The function applied on all pixels of an area (i.e. the zonal statistics) |
filename |
The path where to write the vector layer with the result of the zonal statistics. If set to NULL returns the vector layer object (already). |
A vector layer with the zonal statistics for each band of the input raster added in the attribute table
1 | output <- zonal_pipe(precipitation, belgium, stats = "mean")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.