Virgilio Gómez-Rubio, Thanks for your rapid reply.
 I have got some progress, but still have some problems.
#read the data
case<-readShapePoints("d:/d/case.shp")
control<-readShapePoints("d:/d/control.shp")
guichi<-readShapePoly("d:/d/guichi2.shp")

#Conversion
case_pts <- coordinates(case)
control_pts <- coordinates(control)
splancs_poly <-
getPolygonCoordsSlot(getPolygonsPolygonsSlot(getSpPpolygonsSlot(guichi)[[1]])[[1]])

#perfomr k function, it goes fine,OK
case.khat<-khat(case_pts,splancs_poly,seq(0,23000,500))
control.khat<-khat(control_pts,splancs_poly,seq(0,23000,500))

#errors occurs????????
env.lab <- Kenv.label(case_pts,control_pts,splancs_poly, nsim=999,
seq(0,23000,500))
error:v error in erifyclass(X, "ppp") : argument 'X' is not of class 'ppp'

Q1: Now that khat(splancs) goes fine, why not  Kenv.label(splancs)? From the
help, it didn't say that it needs the point data set to be the class of
ppp(spatstat).

Q2: How to solve it?
 Thanks for your time.



/21/07, Virgilio Gómez-Rubio <v.gomezrubio@imperial.ac.uk> wrote:

> Hi,
>
> El mié, 21-03-2007 a las 22:45 +0800, zhijie zhang escribió:
> > Dear friends,
> >   I have a .shp file of region boundary, and i want to use it as the
> polygon
> > in the khat(splancs) function, but it goes wrong.
> > # khat(pts,poly,s,newstyle=FALSE)
> >
> > guichi<-readShapePoly("d:/d/guichi2.shp")  # read the shp data  of
> region
> > boundary
> > guichi2<-Polygon(coordinates(guichi), hole=as.logical(NA))  #generate
> the
>
> I think that you could try as.points(coordinates(guichi)) here to get
> the boundary in the appropriate format. As far as I know, khat does not
> use sp objects.
>
> Best regards,
>
> Virgilio
>
>
>


-- 
With Kind Regards,

oooO:::::::::
(..):::::::::
:\.(:::Oooo::
::\_)::(..)::
:::::::)./:::
::::::(_/::::
:::::::::::::
[***********************************************************************]
Zhi Jie,Zhang ,PHD
Tel:86-21-54237149   epistat@gmail.com
Dept. of Epidemiology,school of public health,Fudan University
Address:No. 138 Yi Xue Yuan Road,Shanghai,China
Postcode:200032
[***********************************************************************]
oooO:::::::::
(..):::::::::
:\.(:::Oooo::
::\_)::(..)::
:::::::)./:::
::::::(_/::::
:::::::::::::

	[[alternative HTML version deleted]]


