Learn R Programming

spatstat.geom (version 3.6-0)

fillholes.owin: 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

Value

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

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").

See Also

simplify.owin, owin

Examples

Run this code
  ## 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))

Run the code above in your browser using DataLab