# border

From spatstat v1.63-0
by Adrian Baddeley

##### Border Region of a Window

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

##### 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"`

).

##### See Also

##### Examples

```
# NOT RUN {
# rectangle
u <- unit.square()
border(u, 0.1)
border(u, 0.1, outside=TRUE)
# polygon
# }
# NOT RUN {
data(letterR)
plot(letterR)
plot(border(letterR, 0.1), add=TRUE)
plot(border(letterR, 0.1, outside=TRUE), add=TRUE)
# }
```

*Documentation reproduced from package spatstat, version 1.63-0, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.