focalScore | R Documentation |
This function is a wrapper around terra::focal and performs focal statistics in a circle of a specified radius and for three use cases: sum, mean, or fraction cover.
focalScore(r, radius, type)
r |
The raster object on which to perform focal statistics |
radius |
The radius (in m) of the window used for focal statistics |
type |
The function to perform: either "sum" (sum all values in focal window), "mean" (average all values in focal window), or "cover" (fraction cover of a land class of interest). For "cover", the raster must have values of 1 for the feature of interest, and of 0 for the rest. NAs are not considered in sums and means. |
A raster of the same resolution and extent as r, with the focal statistics calculated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.