focal_median | R Documentation |
For each band and for each cell, function finds median value inside of square window. Focal operation of map algebra.
focal_median(x, size = 3, cover = 1e-06, fillNA = FALSE, saveMargin = TRUE, verbose = 0L)
x |
Object of class |
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 |
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_extrem
.
session_grid(NULL)
a <- ursa_dummy(1,mul=1/8,elements=0,bandname="src")
a[a<80] <- NA
bF <- c(fillNA.F=focal_median(a[1],size=5,cover=0.5,fillNA=FALSE))
bT <- c(fillNA.T=focal_median(a[1],size=5,cover=0.5,fillNA=TRUE))
print(c(diff=bT-bF))
d <- c(a,bF,bT)
print(d)
display(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.