In the spatstat library, a point pattern dataset must include
information about the window or region in which the pattern was
observed. A window is described by an object of class `"owin"`

.
Windows of arbitrary shape are supported.
An object of class `"owin"`

has one of three types:
ll{
`"rectangle"`

: a rectangle in the two-dimensional plane with edges parallel to the axes
`"polygonal"`

: a region whose boundary is a polygon or several polygons.
The region may have holes and may consist of several disconnected pieces.
`"mask"`

: a binary image (a logical matrix)
set to `TRUE`

for pixels inside the window and
`FALSE`

outside the window.
}
Objects of class `"owin"`

may be created by the function
`owin`

and converted from other types of data by the function
`as.owin`

. They may be manipulated by the functions
`as.rectangle`

,
`as.mask`

,
`complement.owin`

,
`rotate`

,
`shift`

,
`affine`

,
`erosion`

,
`dilation`

,
`opening`

and
`closing`

.

Geometrical calculations available for windows include
`area.owin`

,
`perimeter`

,
`diameter`

,
`bounding.box`

,
`eroded.areas`

,
`bdist.points`

,
`bdist.pixels`

,
and
`even.breaks.owin`

.
The mapping between continuous coordinates and pixel raster indices
is facilitated by the functions
`raster.x`

,
`raster.y`

and
`nearest.raster.point`

.

There is a `plot`

method for window objects,
`plot.owin`

. This may be useful if you wish to
plot a point pattern's window without the points for graphical
purposes.

There are also methods for
`summary`

and `print`

.