covering | R Documentation |
Given a spatial region, this function finds an efficient covering of the region using discs of a chosen radius.
covering(W, r, ..., giveup=1000)
W |
A window (object of class |
r |
positive number: the radius of the covering discs. |
... |
extra arguments passed to |
giveup |
Maximum number of attempts to place additional discs. |
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.
A point pattern (object of class "ppp"
)
giving the centres of the discs.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.