r-spatial / gstat

Spatial and spatio-temporal geostatistical modelling, prediction and simulation
http://r-spatial.github.io/gstat/
GNU General Public License v2.0
192 stars 49 forks source link

error in fit.variogram.gls: #33

Open jschedler opened 5 years ago

jschedler commented 5 years ago

Ran into this error trying to use the fit.variogram.gls function with my own data, but was able to recreate with the example in the documentation:

library(sp)
data(meuse)
coordinates(meuse) = ~x+y
## Not run: 
 fit.variogram.gls(log(zinc)~1, meuse[1:40,], vgm(1, "Sph", 900,1))

Error in gamfn(h0, theta) : could not find function "gamfn"

  1. fn(par, ...)
  2. (function (par) fn(par, ...))(c(0.213570048247331, 0.213570048247331, 130.891022912055))
  3. optim(init, minfuncols0, gr = NULL, method = "L-BFGS-B", lower = c(0, 1e-09, 1e-09), upper = upperOptim)
  4. fit.variogram.gls(log(zinc) ~ 1, meuse[1:40, ], vgm(1, "Sph", 900, 1))
edzer commented 5 years ago

Thanks - this needs a bit more time to fix.