Your df variable should have coordinates in it and in the form of a matrix
or SpatialPoints (from ?SpatialGridDataFrame: "points  coordinates, either
as numeric matrix or as object of class SpatialPoints-class"). Based on the
code you provided, I would guess that you have a few columns to spare, and
should be removed (kernel, h0) prior to rbinding kcasesC67m and kcontrolC67m
.

HTH,
Roman




On Wed, Aug 25, 2010 at 10:43 AM, Dorothea Lemke <
dorothea.lemke@uni-muenster.de> wrote:

> 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

