[R-sig-Geo] Erron on predict.gstatModel : block kriging for long-lat data undefined

sravankcm sravan.mattevada at unthsc.edu
Mon Dec 16 19:19:47 CET 2013


Hi, 

   I am trying to do Regression Kriging for a metal concentrations with
Depth and Elevation as co-variates.



   Arsenic.txt has columns : X, Y, Metal_Values.
   Covariates are 2 raster files :Depth.tif and Elevation.tif 
   The region is Texas. 

   The projection I am using is : 
           "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"  
   This is the projection of the .tif file I generated using ArcMap. 

    Both the input metal and co-variates are  in same projection and when I
run the command 

  rf <- fit.gstatModel(metal, formulaString, covariates,
method="randomForest") 

   I get below response.

Fitting a randomForest model...
Warning: Shapiro-Wilk normality test and Anderson-Darling normality test
report probability of < .05 indicating lack of normal distribution for
residuals
Fitting a 2D variogram...
Subsetting observations to 68.2 percent
Saving an object of class 'gstatModel'...
     
  but when I try to use the 

   predict.gstatModel(rf,covariates,nmax=12,predict.method="RK", nfold=5)

    I am getting the below error

   Generating predictions using the trend model (RK method)...
[using ordinary kriging]
  0% done
Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim,  : 
  gstat: value not allowed for: block kriging for long-lat data undefined

I read through a post having a similar error and changed the projection  to 
"+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs
+ellps=WGS84 +towgs84=0,0,0"

but this way even the fit.gstatModel(metal, formulaString, covariates,
method="randomForest") 

is throwing an error

Fitting a randomForest model...
Error in randomForest.default(m, y, ...) : data (x) has 0 rows
In addition: Warning message:
In randomForest.default(m, y, ...) :
  The response has five or fewer unique values.  Are you sure you want to do
regression?

Can anybody please help me get the prediction results ? 

 
Thanks 



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Erron-on-predict-gstatModel-block-kriging-for-long-lat-data-undefined-tp7585375.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list