[R-sig-Geo] SpatialGridDataFrame to SpatialPixelDataFrame

Dorothea Lemke dorothea.lemke at uni-muenster.de
Wed Aug 25 10:43:48 CEST 2010


Dear list,

I have problems to coerce a SpatialGridDataFrame object to a
SpatialPixelDataFrame. I 've calculated a kerneldensity (splancs) and I want
to convert the results from the SpatialGridDataFrame to a
SpatialPixelDataFrame.

My R-code:

>library (maptools)
>library (splancs)
>library (rgdal)

> kcasesC67m<-spkernel2d(cases, pRBMS, h0=3500, gt)
> kcontrolsC67m<-spkernel2d(controls, pRBMS, h0=3500, gt)
> df<-data.frame(kcasesC67m=kcasesC67m, kcontrolsC67m=kcontrolsC67m)
> spkratio<-SpatialGridDataFrame(gt, data = df)
> spkratioP<-as(spkratio, "SpatialPixelDataFrame")

But I get the error message: "No methods and no standards to convert
SpatialGridDataFrame in SpatialPixelDataFrame".

Many thanks for your help
Dorothea



More information about the R-sig-Geo mailing list