Regression kriging error
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 07/19/2013 05:35 PM, Israel Ikoyi wrote:
Hi, I am trying to do regression kriging with this commands: #Regression modeling regSI <- lm(SI~OrgMat+Moisture+pH, data = malpie) summary(regSI) # add residual to malpie malpie$resSI <- regSI$residuals # calculate variogram of residual gresSI <- gstat(id="resids", formula = resSI~1, data = malpie) vgresSI <- variogram(gresSI) plot(vgresSI,plot.nu=T) vgmresSI <- fit.variogram(vgresSI, model=vgm(psill=400, range=150, model="Sph", add.to= vgm(psill=100, range=500, model="Sph"))) plot(vgresSI, vgmresSI, ylim=c(0,600)) vgmresSI #regression kriging malpie_rk <- krige(SI~OrgMat+Moisture+pH, locations=malpie, newdata=zgrid) # regression part only! malpie_rok <- krige(residuals(regSI)~1, locations=malpie, newdata=zgrid, model=vgmresSI) # OK of residuals CHALLENGE: the regression part gives me the error message: Error in eval(expr, envir, enclos) : object 'OrgMat' not found. Can someone help me on how to solve this?
A wild guess: OrgMat is not present, as layer, in zgrid, or in malpie. Providing a reproducible example would allow me to help, instead of wildly guessing.
Israel Ikoyi [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org 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 83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJR6WGRAAoJEM1OCHCtOnfx3i4H/RnZ2aZKUaF9vfz4ssiuGtVY cdYskQo9kLAMM5DUy9a71bse2r0lIfvh2uaPavcqvRMAVGHOTIsbIJk9CIuBTTOw mLPXbg5hEmBIRnbeqty8nGTsyu9us4safAqZcOTsmqsuu9k0PMF8DSwNI/8mxMtr +wJbs8b7mq0p4cphCoh+QoUuCI+lYoW8GeLjj6Aytkj7qS/PA2s7Y296NGmGb6Ad EUhEgPNqLcVPMUeSlwFjGzDSEgkzdrPG89IGmtUKLqsuk0TOBrcdZCAeru+KImgu ts8L8ed4dPVQGGrtbFYUBCD1+HUttldVGNbVfkWF46xeVDDRhwrgmRZ87W7/E0g= =TBWQ -----END PGP SIGNATURE-----