Dear All,

I am doing regression kriging  of a small dataset."How can i stop krige()
function from deleting the NA columns in my input data"
1.
# define the linear model by ordinary least squares prediction
pb.ols <- lm(pb ~ geul$eucdist + geul$elev, data=geul)
2.
# add residual to geul
geul$res = pb.ols$residuals
3.
#apply regression model to all unobserved locations
dist$pb.ols =  -1.057 * dist$band1 +  17.753 * dem$band1 -1200.216
# calculate variogram of residual
gres = gstat(id = c("res"), formula = res~1, data = geul)
vgres = variogram(gres)
vgmres = vgm(nugget=10000, psill=15000, range=300, model="Sph")
vgmres = fit.variogram(vgres,vgmres)
4.
#kriging
geul.krigres = krige(res~1, geul, newdata = dem,vgmres)
5.
#add the kriged and interpolated values
rk.krige=geul.krigres$var1.pred + dist$pb.ols

I managed to do all steps 1 to 4 without any problems but on step 5 i am
getting this error message: " rk.krige=geul.krigres$var1.pred + dist$pb.ols
Warning message:
In geul.krigres$var1.pred + dist$pb.ols :
  longer object length is not a multiple of shorter object length
>
"
any suggestions?

regards,

Nikki

	[[alternative HTML version deleted]]

