Spatial patterns: I have a dataset of coordinates and marks (diameter) attributed to the points. I am trying to create a window (owin()) for each plot (I have 2 plots), but I don't know how to set the window for both plots:
My window:
#data: rea_spd "SpatialPointsDataFrame'
w <- owin(xrange = c(min(rea_spd$Longitude_), max(rea_spd$Longitude_)),
yrange=c(min(rea_spd$Latitude_N), max(rea_spd$Latitude_N)))
plot(w)
#this produces a window for all the data, but I don't know how to adapt it to have a window for each plot.
#After, I calculated Kcross, which works, but I still need to have two windows, otherwise, I will violate the statistical assumptions:
kmultrea <- envelope(reav, Kcross, nsim=999, i="A", j="S",
global=F, savefuns=TRUE, conf.level= 0.95)
plot(kmultrea,main="Cross-K - Protected area", xlab = "Distance r [m]",
xlim = c(0,30), ylim=c(0, 6000), legend = F)
pk <- LF.gof(kmultrea) #
pk
I tried to follow this example, but I still do not receive the points inside the windows:
m = matrix(0,20,20)
m[1+20*cbind(c$x,c$y)]=1
imask = owin(c(0,1),c(0,1),mask = t(m)==1 )
pp1 = ppp(x=c$x,y=c$y,window=imask)
plot(pp1)
Determining if trees within forest gaps are clustered using R?
