inside.swin: Test whether points are inside a sampling window

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/swin.R

Description

Function inside.swin tests whether points lie inside or outside a given sampling window.

Usage

1
inside.swin(x, y, w, bdry=TRUE)

Arguments

x

a vector of x coordinates of points.

y

a vector of y coordinates of points.

w

an object of class "swin" (see swin) defining the sampling window.

bdry

by default bdry = TRUE. If FALSE, points located on the boundary of the sampling window are considered to be outside.

Value

A logical vector whose ith entry is TRUE if the corresponding point (x[i],y[i]) is inside w, FALSE otherwise.

Note

For "complex" sampling windows, points inside the triangles to remove or on their boundary, are considered outside.

Author(s)

Raphael.Pelissier@ird.fr

See Also

swin.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  data(BPoirier)
  BP <- BPoirier
  wr <- swin(BP$rect)
  sum(inside.swin(BP$trees$x, BP$trees$y, wr))
  
  wc <- swin(c(55,45,45))
  sum(inside.swin(BP$trees$x, BP$trees$y, wc))
  
  wrt <- swin(BP$rect, triangles=BP$tri1)
  sum(inside.swin(BP$trees$x, BP$trees$y,wrt))

ads documentation built on March 16, 2021, 5:08 p.m.

Related to inside.swin in ads...