[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}


data(meuse)

 > class(meuse)
[1] "SpatialPointsDataFrame"
attr(,"package")
[1] "sp"


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

And then try this:

Kest(zn1)


Regards,

Marcelino


At 10:44 08/05/2008, Agustin Lobo wrote:
>Hi!
>
>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?).
>
>Thanks!
>
>Agus
>--
>Dr. Agustin Lobo
>Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
>LLuis Sole Sabaris s/n
>08028 Barcelona
>Spain
>Tel. 34 934095410
>Fax. 34 934110012
>email: Agustin.Lobo at ija.csic.es
>http://www.ija.csic.es/gt/obster
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

________________________________

Marcelino de la Cruz Rot

Departamento de  Biología Vegetal
E.U.T.I. Agrícola
Universidad Politécnica de Madrid
28040-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