fillholes.owin: Remove Small Holes in a Window

View source: R/wingeom.R

fillholes.owinR Documentation

Remove Small Holes in a Window

Description

Given a window, this function removes any small holes in the window.

Usage

fillholes.owin(W, amin)

Arguments

W

Window (object of class "owin").

amin

Numeric value. The smallest permissible area of a hole.

Details

This function simplifies a window W by removing any holes with area less than amin.

The argument W must be a window (object of class "owin").

Value

Another window (object of class "owin") of the same type as W.

Author(s)

\spatstatAuthors

.

See Also

simplify.owin, owin

Examples

  ## make object with small hole
  A <- meningitis$kreise
  W <- setminus.owin(Window(A), tiles(A)[[102]])
  amin <- 500

  opa <- par(mfrow=c(1,2))
  plot(W)
  plot(fillholes.owin(W, amin))

  M <- as.mask(W)
  plot(M)
  plot(fillholes.owin(M, amin))

spatstat.geom documentation built on Aug. 8, 2025, 6:28 p.m.