[R-sig-Geo] help on Polygon(sp)?

Roger Bivand Roger.Bivand at nhh.no
Wed Mar 21 18:47:20 CET 2007


On Wed, 21 Mar 2007, Virgilio Gómez-Rubio wrote:

> Hi,
> 
> > #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).
> 
> The problem is not in Kenv.label() but in rlabel(), which is called from
> Kenv.label and that has versions in Splancs and Spatstat. So, if you
> loaded Spatstat after Splancs, then you will be using the 'wrong' (non-
> Splancs) version. My advice is to load Splancs only and do the analysis.
> 

These things do happen, I think that neither splancs nor spatstat have 
namespaces, which restrict the visibility of functions, so here you need 
to be careful. The warning:

        The following object(s) are masked from package:splancs :

         rlabel 

should have been displayed.

> I think you could use Spatstat as well to get the envelopes of the K-
> function (using envelope() ) but it might require a few more lines of
> code.

And if you use spatstat, you can convert the SpatialPolygons to owin with 
functions in maptools:

as(guichi, "owin")

ought to do it.

Roger

> 
> Best,
> 
> Virgilio
> 
> P.S: Is it wise to use variable names with underscore in it?
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list