Learn R Programming

ads (version 1.4)

area.swin: Area of a sampling window

Description

Function area.swin computes the area of a sampling window.

Usage

area.swin(w)

Arguments

w
an object of class "swin" defining the sampling window.

Value

  • The area of the sampling window.

encoding

latin1

Details

For "simple" sampling windows, returns simply the area of the rectangle or circle delineating the study region. For "complex" sampling windows, returns the area of the initial rectangle or circle, minus the total area of the triangles to remove (see swin).

See Also

swin.

Examples

Run this code
#rectangle of size [0,110] x [0,90]
  wr<-swin(c(0,0,110,90))
  area.swin(wr)
  
  #circle with radius 50 centred on (55,45)
  wc<-swin(c(55,45,50))
  area.swin(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))
 area.swin(wp)

Run the code above in your browser using DataLab