sparkle_fill: Sparkle fill: fill small holes in raster or matrix

sparkle_fillR Documentation

Sparkle fill: fill small holes in raster or matrix

Description

Fill RasterLayer or matrix with small gaps (sparkles) using specs defined in "min_sides" and "fun"

Usage

sparkle_fill(x, min_sides = 4, fun = "median", matlon, matlat, ...)

Arguments

x

RasterLayer or matrix to fill gaps for

min_sides

Number of non NA sides required (e.g. min_sides = 5 means 5 out of a possible 8 pixels directly adjacent to "sparkle" must be non NA)

fun

String of function to fill gap. Current options are "mean", "median" and "bilinear"

matlon

If x is a matrix, it needs a matrix of latitudes with dim(matlon) == dim(x)

matlat

If x is a matrix, it needs a matrix of longitudes with dim(matlat) == dim(x)

Value

Filled RasterLayer or matrix


BIO-RSG/oceancolouR documentation built on April 30, 2024, 7:54 a.m.