fill_na | R Documentation |
Apply a function to NA cells within a moving window.
fill_na(x, fun, w, outfile, return_rast = FALSE, overwrite = FALSE)
x |
A |
fun |
The function (name or symbol) to apply to the moving windows. First argument should represent the vector of cells contained in the focal window. Only non-NA cell values will be passed to the function. |
w |
A weights matrix (see |
outfile |
Character. File path to an output raster file. If missing, a temporary file will be used. |
return_rast |
Logical. Should the |
overwrite |
Logical. Should |
NA values within focal blocks will be ignored. Raster edges will be
NA-padded to allow focal computations at the edge (see raster::focal()
.
Returns the resulting RasterLayer
if return_rast
is
TRUE
. Returns the output file path otherwise.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.