[R-sig-Geo] Help importing ascii DTM with no data values for Kriging with External Drift
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Wed Nov 4 14:51:43 CET 2009
Tobin Cara wrote:
> Hello,
>
> I am having problems with kriging an ascii file DTM from ArcGIS which has many -9999 (no data) values. Do these normally have to be removed first? I want to make the elevation DTM the predictor base for kriging with external drift.
>
>
the nodata values should be automatically converted, as the header
defines them.
> My code is the following:
> elev <- read.asciigrid("elev.asc", as.image=FALSE, plot.image=TRUE)
> str(elev)
> elev_ked <- krige(meanRain~Zloc, locations=meanRain, newdata=elev, model=fitted_vario)
>
This assumes that something called Zloc is available both in meanRain
and in elev, which is unlikely in your case.
Try to make a habit of using the formulation
elev_ked <- krige(meanRain~Zloc, meanRain, elev, fitted_vario)
i.e., without named arguments.
> Error in model.frame.default(terms.f, newdata, na.action = na.action) :
> object is not a matrix
> In addition: Warning message:
> 'newdata' had 550448 rows but variable(s) found have 1 rows
>
> My data file meanRain has X Y Z coordinates and Precipitation values (4 columns).
>
> Thank you so much for your time and help!
>
> Cara
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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.springer.com/978-0-387-78170-9 e.pebesma at wwu.de
More information about the R-sig-Geo
mailing list