[R-sig-Geo] Converting spatialPointsDataFrame into ppp

Marcelino de la Cruz marcelino.delacruz at upm.es
Thu May 8 11:09:39 CEST 2008

 From the help of as.ppp {maptools}


 > class(meuse)
[1] "SpatialPointsDataFrame"
[1] "sp"

coordinates(meuse) = ~x+y
zn1 <- as(meuse["zinc"], "ppp")

And then try this:




At 10:44 08/05/2008, Agustin Lobo wrote:
>Is it possible (and if yes, how) to convert from an spatialPointsDataFrame
>to a ppp object (selecting the appropriate variable in the
>dataframe) so that I can run Kest ?
>I've tried with as.ppp with no success.
>(I always have a bad time converting among the different spatial
>objects in R, I promise contributing a flow chart soon, or is ti
>included in the new book?).
>Dr. Agustin Lobo
>Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
>LLuis Sole Sabaris s/n
>08028 Barcelona
>Tel. 34 934095410
>Fax. 34 934110012
>email: Agustin.Lobo at ija.csic.es
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch


Marcelino de la Cruz Rot

Departamento de  Biología Vegetal
E.U.T.I. Agrícola
Universidad Politécnica de Madrid
Tel.: 91 336 54 35
Fax: 91 336 56 56
marcelino.delacruz at upm.es

More information about the R-sig-Geo mailing list