首页 > 代码库 > 插值和空间分析(R语言)

插值和空间分析(R语言)

> library(lattice)> library(sp)> data(meuse)> coordinates(meuse) <- c("x","y")> spplot(meuse, "zinc", do.log=T)
> bubble(meuse, "zinc", do.log=T, key.space="bottom")



> xyplot(log(meuse$zinc)~sqrt(meuse$dist), meuse, main="", xlab="dist", ylab="Zn")

> meuse$fitted.s <- predict(zn.lm, meuse) - mean(predict(zn.lm,meuse))> meuse$residuals <- residuals(zn.lm)> spplot(meuse, c("fitted.s", "residuals"))> spplot(meuse, c("fitted.s", "residuals"))

> library(gstat)> idw.out <- idw(zinc~1, meuse, meuse.grid, idp=1)[inverse distance weighted interpolation]> spplot(idw.out)
> spplot(idw.out, c("var1.pred"))

  

 

插值和空间分析(R语言)