[R-sig-Geo] Interpolation / smoothing of points (without raster grids)
Paul Hiemstra
p.hiemstra at geo.uu.nl
Tue May 12 11:36:48 CEST 2009
mike.elliott at openreach.co.uk wrote:
> Hello - can anyone suggest functions/packages that allow interpolation /
> smoothing of point data (without using raster grids)? i.e. which give
> the results at the original point locations.
>
> Many thanks, Mike Elliott.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
If you could tell us more in detail what you want to do, we could offer
you more guidance. To add to the promotion of packages that we wrote
ourselves (edzer :)), you can also use automap, a package for automatic
interpolation based on gstat and sp (two other packages). For
cross-validation (if this is what you need) the following script will do
the trick:
library(automap)
# Load the data
data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
gridded(meuse.grid) = ~x+y
# Perform cross-validation
kr.cv = autoKrige.cv(log(zinc)~1, meuse, model = c("Exp"))
kr_dist.cv = autoKrige.cv(log(zinc)~sqrt(dist), meuse,
model = c("Exp"))
kr_dist_ffreq.cv = autoKrige.cv(log(zinc)~sqrt(dist)+ffreq,
meuse, model = c("Exp"))
# Compare the results
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv)
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE)
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE, col.names = c("OK","UK1","UK2"))
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE, col.names = c("OK","UK1","UK2"),
plot.diff = TRUE)
automap is available from CRAN.
cheers and good luck,
Paul
--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: +3130 274 3113 Mon-Tue
Phone: +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul
More information about the R-sig-Geo
mailing list