randsample.fn=function(data,area1,area2,N){ #area1 is the area of observed plot, area2 is the area of expected plot
r1=sqrt(area1/pi)
r2=sqrt(area2/pi)
expplot=data.frame()
for (j in 1:N){
R=runif(1,0,r1-r2)
theta=runif(1,0,360)
xa=R*sin(theta*pi/180)
ya=R*cos(theta*pi/180)
expdata=data[sqrt((data$x-xa)^2+(data$y-ya)^2)