Fill NA values within a mask region

fill_mask(x, mask, fill, offset = 0, clamp = FALSE)

Arguments

x

Source raster to fill/pad.

mask

Extent of the spatial region to fill.

fill

Value used for filling.

offset

Additional value to add to all locations within mask.

clamp

Logical. Set to TRUE to give all locations outside mask region an NA value.