Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

covering

Cover Region with Discs


Description

Given a spatial region, this function finds an efficient covering of the region using discs of a chosen radius.

Usage

covering(W, r, ..., giveup=1000)

Arguments

W

A window (object of class "owin").

r

positive number: the radius of the covering discs.

...

extra arguments passed to as.mask controlling the pixel resolution for the calculations.

giveup

Maximum number of attempts to place additional discs.

Details

This function finds an efficient covering of the window W using discs of the given radius r. The result is a point pattern giving the centres of the discs.

The algorithm tries to use as few discs as possible, but is not guaranteed to find the minimal number of discs. It begins by placing a hexagonal grid of points inside W, then adds further points until every location inside W lies no more than r units away from one of the points.

Value

A point pattern (object of class "ppp") giving the centres of the discs.

Author(s)

Examples

rr <- 0.5
  X <- covering(letterR, rr)
  plot(grow.rectangle(Frame(X), rr), type="n", main="")
  plot(X, pch=16, add=TRUE, col="red")
  plot(letterR, add=TRUE, lwd=3)
  plot(X %mark% (2*rr), add=TRUE, markscale=1)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.