Fill NA values in a SpatRast object

fill_na(rst, mask = NULL, layer_names = names(rst))

Arguments

rst

SpatRast (or path to file) to infill

mask

SpatRast (or path to file) defining non-NA cells (omit for all cells)

layer_names

names of layers to infill (omit for all layers)

Details

rst and mask should have the same extent and resolution. The NA values in rst are infilled using the most common neighbouring value through multiple passes of focal.