I'd like to create a spatial separation distance up to which point pairs are included in semivariance estimates (cutoff function in variogram {gstat}), but using autofitVariogram in automap package. Despite the use of miscFitOptions function nothing happened (error or expected output). In my example below I'd like to cutoff at 1000m the meuse data set:
# Packages
library(automap)
library(gstat)
# Classical meuse dataset example
data(meuse)
coordinates(meuse) = ~x+y
# Funcion autofitVariogram
autoZn=autofitVariogram(log(zinc)~1, meuse)
summary(autoZn)
# Plot variogram
plot(autoZn, pch=19, col="black")
# Now with 1000 meters cutoff
autoZn_cut=autofitVariogram(log(zinc)~1, meuse, cutoff=1000)
summary(autoZn_cut)
plot(autoZn_cut, pch=19, col="black")
# or
autoZn_cut=autofitVariogram(log(zinc)~1, meuse, miscFitOptions = list(cutoff=1000))
summary(autoZn_cut)
plot(autoZn_cut, pch=19, col="black")
But in the three plots do not change anything and I don't have any error?
Please, any help with it?



I modified the
autofitVariogramfunction (I call itmy_autofitVariogram) adding aboundariesoption.You can copy
my_autofitVariogramin a file (namedmy_autofitVariogram.r), and put it in your working directory. Then, run this sample code: