title: How to make Ordinary Kriging by using gstat predict
body: <p>I am trying to write a code in R that use gstat library in order to create an interpolation.
  I have already read the gstat manual and based on some examples on internet I had managed to write this code (this is only a part):</p>
  
  <pre><code> g &lt;- gstat(id="tec", formula=TEC ~ 1, data=data)  ##I create an object
   v &lt;- variogram(g) # plot the empirical variogram
   plot(v)
   mod&lt;-vgm(sill=var(data$TEC),model="Sph",range=200,nugget=200) #create the variogram model
  
  v.fit &lt;- fit.variogram(v, model=mod,fit.method=1)  #fit the empirical variogram 
  Theor_variogram=plot(variogram(g),v.fit,main="WLS Model") #plot the theoretical variogram
  plot(Theor_variogram)
   ## Kriging interpolation
   p &lt;- predict.gstat(g, model=v.fit, newdata=predGrid)
  </code></pre>
  
  <p>My problem is that, when I run the last command (predict) instead of getting a result with ordinary kriging interpolation, I get one with inverse distance weighted (IDW).
  I read in the gstat manual that:  "When no variograms are specified, inverse distance weighted interpolation
  is the default action.
  When variograms are specified the default prediction method is ordinary
  kriging."</p>
  
  <p>But, as you can see in my code, I specify both the empirical and theoretical variogram. 
  Do you know why I keep getting IDW instead of ordinary kriging? Can it be related with the type of coordinates that I have? If for example I have coordinates close to each other, or if the region of interest is too big?
  Any help would be really useful.</p>
  
  <p>Thanks in advance
  Dimitris</p>