focal_extrem | R Documentation |
For each band and for each cell, depending of specification, function finds either minimal or maximal value inside of square window. Focal operation of map algebra.
focal_extrem(x, kind = c("min", "max"), size = 3, cover = 1e-06,
fillNA = FALSE, saveMargin = TRUE, verbose = 0L)
focal_min(x, size = 3, cover = 1e-06, fillNA = FALSE, saveMargin = TRUE, verbose = 0L)
focal_max(x, size = 3, cover = 1e-06, fillNA = FALSE, saveMargin = TRUE, verbose = 0L)
x |
Object of class |
kind |
Character. What kind of extremum is required. Allowed values |
size |
Positive numeric. Odd values (3, 5, 7, ...) are allowed, but if other value is specified, then it expanded to the next odd value not less than original value. Default is |
cover |
Numeric. |
fillNA |
Logical. If |
saveMargin |
Logical. If |
verbose |
Integer of |
focal_min(x,...)
is a wrapper to focal_extrem(x,"min",...)
focal_max(x,...)
is a wrapper to focal_extrem(x,"max",...)
Object of class ursaRaster
with the same number of bands as in input raster.
Nikita Platonov platonov@sevin.ru
Other focal operations: focal_mean
, focal_median
.
session_grid(NULL)
a <- ursa_dummy(nband=2,mul=1/8,elements=32)
a[a<80] <- NA
b.min <- focal_extrem(a,"min",size=4,cover=0.5,verbose=1L)
b.max <- focal_extrem(a,"max",size=4,cover=0.5,verbose=1L)
print(list(src=a,min=b.min,max=b.max,dif=b.max-b.min))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.