[R-sig-Geo] Cell declustering examples in Gstat
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Mon Feb 22 11:53:07 CET 2010
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
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
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics e.pebesma at wwu.de
More information about the R-sig-Geo
mailing list