Dear friends,
In the paper:[*Rowlingson,B.S.&Diggle,P.J. Splancs:Spatial Point Pattern
Analysis Code in S-Plus,1993, Computers and Geosciences, 19, 627-655]* ]
# method of testing for CSR using F/G function was introduced, the original
programs in the paper is as the followings:
pts<-spoints(scan('sinks.xy'))
np<-npts(pts)
poly<-spoints(scan('sinks.poly')) #here is my question:my data only have
points data, no poly data,so i need to generate the poly,see the following
ploymap()
pointmap(pts,add=T)
s<-seq(0.015,0.3,length=20)
#compute the D statistic
g<-Ghat(pts,s)
*grid.pts<-gridpts(poly,10*np)* #generate points in poly,my dataset don't
have the information of poly
f<-Fhat(pts,grid.pts,s)
D<-max(abs(f-g))
#to perform 99 simulations --FOR loop
for (i in 2:100) {
spts<-csr(poly,np) # genenrate np points in the poly ,my dataset don't
have the information of poly
g<-Ghat(spts,s)
f<-Fhat(spts,grid.pts,s)
test<-max(abs(f-g))
D<-c(D,test)
}
-------------------------------
The original programs are really works!
*I will use the points generated by runif to point out my problem:*
x<-runif(20)
y<-runif(20)
xy<-cbind(x,y)
pts<-as.points(xy) #generate the points
np<-npts(pts)
plot(pts)
*bbox(pts) #generate the poly*
polymap(sbox(pts),add=T)
s<-seq(0,1,length=20)
g<-Ghat(pts,s)
grid.pts<-gridpts(polymap(bbox(pts)),10*np) *#error in bbox(poly) : object
not a >= 2-column array*
I don't know why it is wrong. How to do a testing for CSR using F/G
function on points data without polygon information?
Thanks very much!
--
Kind Regards,
Zhi Jie,Zhang ,PHD
Department of Epidemiology
School of Public Health
Fudan University
Tel:86-21-54237149
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo