swin {ads}R Documentation

Creating a sampling window

Description

Function swin creates an object of class "swin", which represents the sampling window (or study region) in which a spatial point pattern was observed. The ads library supports simple (rectangular or circular) and complex sampling windows.

Usage

 swin(window=c(xmin,ymin,xmax,ymax))
 swin(window=c(x0,y0,r0))
 swin(window, triangles)

Arguments

window a vector defining the limits of a simple sampling window: c(xmin,ymin,xmax,ymax) for a rectangle ; c(x0,y0,r0) for a circle.
triangles (optional) a list of triangles removed from a simple initial window to define a complex sampling window (see Details).

Details

A sampling window may be of simple or complex type. A simple sampling window may be a rectangle or a circle. A complex sampling window is defined by removing triangular surfaces from a simple (rectangular or circular) initial sampling window.

Value

An object of class "swin" describing the sampling window. It may be of four different types with different arguments:

$type a vector of two character strings defining the type of sampling window among c("simple","rectangle"), c("simple","circle"), c("complex","rectangle") or c("complex","circle").
$xmin,$ymin,$xmax,$ymax (optional) coordinates of the origin and the opposite corner for a rectangular sampling window (see details).
$x0,$y0,$r0 (optional) coordinates of the center and radius for a circular sampling window (see details).
$triangles (optional) vertices coordinates of triangles for a complex sampling window (see details).

Note

There are printing, summary and plotting methods for "swin" objects.
Function swin2owin(swin.object) coerces an object of class "swin" into an owin.object suitable for use with package spatstat.

Author(s)

Raphael.Pelissier@ird.fr

References

Goreaud, F. and Pélissier, R. 1999. On explicit formula of edge effect correction for Ripley's K-function. Journal of Vegetation Science, 10:433-438.

See Also

area.swin, inside.swin, swin2owin, spp

Examples

  #rectangle of size [0,110] x [0,90]
  wr<-swin(c(0,0,110,90))
  summary(wr)
  plot(wr)
  
  #circle with radius 50 centred on (55,45)
  wc<-swin(c(55,45,50))
  summary(wc)
  plot(wc)
  
 # polygon (diamond shape)
 t1<-c(0,0,55,0,0,45)
 t2<-c(55,0,110,0,110,45)
 t3<-c(0,45,0,90,55,90)
 t4<-c(55,90,110,90,110,45)
 wp<-swin(wr,rbind(t1,t2,t3,t4))
 summary(wp)
 plot(wp)
 
 #rectangle with a hole
 h1<-c(25,45,55,75,85,45)
 h2<-c(25,45,55,15,85,45)
 wrh<-swin(wr,rbind(h1,h2))
 summary(wrh)
 plot(wrh)

 #circle with a hole
 wch<-swin(wc,rbind(h1,h2))
 summary(wch)
 plot(wch)

[Package ads version 1.2-9 Index]