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

owin.object

Class owin


Description

A class owin to define the “observation window” of a point pattern

Details

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:

"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.owin, boundingbox, 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.

Warnings

In a window of type "mask", the row index corresponds to increasing y coordinate, and the column index corresponds to increasing x coordinate.

Author(s)

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

See Also

Examples

w <- owin()
 w <- owin(c(0,1), c(0,1))
 # the unit square
  
 w <- owin(c(0,1), c(0,2))
 if(FALSE) {
   plot(w)
   # plots edges of a box 1 unit x 2 units
   v <- locator() 
   # click on points in the plot window
   # to be the vertices of a polygon 
   # traversed in anticlockwise order 
   u <- owin(c(0,1), c(0,2), poly=v)
   plot(u)
   # plots polygonal boundary using polygon()
   plot(as.mask(u, eps=0.02))
   # plots discrete pixel approximation to polygon
 }

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.