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

border

Border Region of a Window


Description

Computes the border region of a window, that is, the region lying within a specified distance of the boundary of a window.

Usage

border(w, r, outside=FALSE, ...)

Arguments

w

A window (object of class "owin") or something acceptable to as.owin.

r

Numerical value.

outside

Logical value determining whether to compute the border outside or inside w.

...

Optional arguments passed to erosion (if outside=FALSE) or to dilation (if outside=TRUE).

Details

By default (if outside=FALSE), the border region is the subset of w lying within a distance r of the boundary of w. It is computed by eroding w by the distance r (using erosion) and subtracting this eroded window from the original window w.

If outside=TRUE, the border region is the set of locations outside w lying within a distance r of w. It is computed by dilating w by the distance r (using dilation) and subtracting the original window w from the dilated window.

Value

A window (object of class "owin").

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

# rectangle
   u <- unit.square()
   border(u, 0.1)
   border(u, 0.1, outside=TRUE)
# polygon
   
   plot(letterR)
   plot(border(letterR, 0.1), add=TRUE)
   plot(border(letterR, 0.1, outside=TRUE), add=TRUE)

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.