within {cyclones} | R Documentation |
Finds points within a given closed 2-D boundary.
within(x,y,X,Y,test=FALSE,plot=FALSE) testWithin(a=3,b=5)
x |
vector with x-cordinates to test if they lie inside given boundary. |
y |
vector with y-cordinates to test... |
X |
vector of x-coordinates of the boundary. |
Y |
vector of y-coordinates of the boundary. |
plot |
TRUE if plotting results. |
test |
TRUE if conducting test. |
a |
x-axis of ellipse. |
b |
y-axis of ellipse. |
Bolean vector of same length as x
.
R.E. Benestad
x <- rnorm(100) y <- rnorm(100) X <- cos(2*pi*seq(0,1,length=360)) Y <- cos(2*pi*seq(0,1,length=360)) print(sum(within(x,y,X,Y)))