rgstat

Extracting fitted values of a variogram model


How can I extract the fitted values (not parameters!) of a variogram model? I intend to draw the theoretical variogram in the Excel software.

I used the fit.variogram in gstat package as follows:

library(sp)
data(meuse)
coordinates(meuse) = ~x+y
vgm1 <- variogram(log(zinc)~1, meuse)
fit.variogram(vgm1, vgm(1, "Sph", 300, 1))
fit.variogram(vgm1, vgm("Sph")) 

I need the set of data used in plot function in R.


Solution

  • There are functions variogramLine (spatial vgm) and variogramSurface (spatio-temporal vgm) in gstat that will evaluate the vgm model for a provided set of distances.