[R-sig-Geo] Plotting SpatialPixelDataFrame

Dorothea Lemke dorothea.lemke at uni-muenster.de
Thu Aug 26 09:33:52 CEST 2010


Dear list,

I've a problem with plotting a numeric object in a SpatialPixelsDataFrame.
I've done 2 Kerneldensity estimations with the package splancs and I've
calculated the relative risk by taking the ratio of this two intensities. When
I use the spplot() function I get one window with 3 graphics on the same
scale. But I want to plot the graphics with seperate scales. How can I do
this?

My Rcode is:

  > kcasesC67m<-spkernel2d(cases, pRBMS, h0=3500, gt)
  > kcontrolsC67m<-spkernel2d (controls, pRBMS, h0=3500, gt)
  > df0<-data.frame (kcasesC67m = kcasesC67m, kcontrolsC67m = kcontrolsC67m)
  > spkratio0<-SpatialGridDataFrame (gt,  data = df0)
  > spkratio<-as(spkratio0, "SpatialPixelsDataFrame")
  > spkratio$kratio<-spkratio$kcasesC67m/spkratio$kcontrolsC67m
  > is.na(spkratio$kratio)<-!is.finite(spkratio$kratio)

Many thanks for your help

Dorothea



More information about the R-sig-Geo mailing list