[R-sig-Geo] Cell declustering examples in Gstat

Dylan Beaudette debeaudette at ucdavis.edu
Mon Feb 22 18:41:38 CET 2010


On Monday 22 February 2010, Edzer Pebesma wrote:
> Carlos, please try:
>
> library(gstat)
> data(meuse)
> meuse$rn = 1:nrow(meuse)
> coordinates(meuse)=~x+y
> spplot(meuse["rn"])
> data(meuse.grid)
> gridded(meuse.grid)=~x+y
> out = krige(rn~1, meuse, meuse.grid, nmax=1)
> spplot(out[1])
> meuse$w = as.vector(table(out[[1]])/sum(table(out[[1]])))
> spplot(out[1],col.regions=bpy.colors(),sp.layout=list("sp.points",meuse))
> spplot(meuse["w"], col.regions=bpy.colors())
>
> Having a somewhat finer interpolation grid might give slightly more
> satisfactory results.
>
> Best regards,
> --
> Edzer

Thanks for the example Edzer. This is a really interesting demonstration of 
cell declustering... however, pardon my lack of understanding, I can't quite 
figure out how the resulting are obtained by interpolating the row numbers. 
Can you please elaborate on how/why the use of row numbers and setting nmax=1 
produces these results?

Thanks!

Dylan


>
> Carlos Alberto Gutierrez Carvajal wrote:
> > Hello everybody in the list.
> >
> > My question have been treated previously by Edzer Pebesma in his
> > communications with Stefano Pegoretti in july 2007, however I would
> > find very useful some examples.
> >
> > Basically, Edzer Pebesma pointed to two methods to perform cell
> > declustering.
> >
> > One of these methods is voronoi diagrams (avaliable in package deldir).
> >
> > The other method is, in words of Edzer Pebesma, by  'using the number
> > of nearest cells based on a regular discretization of the study area;
> > for the latter you could misuse package gstat, interpolate record
> > number with nmax=1 and compute a table of the resulting "prediction"
> > grid'.
> >
> > Could you provide me some examples for each one of this methods for an
> >  R user,please?.
> >
> > Regards,
> >
> > Carlos Gutierrez Carvajal.
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341



More information about the R-sig-Geo mailing list