R version 3.3.2, Windows 10: gstat package: Error in fitting a variogram model using 'fit.variogram' function

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

R version 3.3.2, Windows 10: gstat package: Error in fitting a variogram model using 'fit.variogram' function

Rathore, Saubhagya Singh
Hello Everyone,

I am having some problem with fit.variogram  function of the gstat package.  My code, data, error message and traceback() message can be found below. Any suggestion to approach this problem would be appreciated.
# Code Starts---------------------------------------------------------------------------------------------------------------------------------------------------
mydf<-as.data.frame(read.table("Sample_data.xlsx",header = TRUE,sep = ",",na.strings = "EMPTY"))
coordinates(mydf) = ~x+y
c.vgm.exp<-variogram(z~1,data=mydf,cutoff=60000, width = 60000/15)
c.vgm.fit<-fit.variogram(c.vgm.exp,vgm(nugget=1000000,psill=6000000,model ="Exp",range = 40000),fit.method = 7)
# Code End--------------------------------------------------------------------------------------------------------------------------------------------------------

Data file can be obtained from:

Error Message:
> c.vgm.fit<-fit.variogram(c.vgm.exp,vgm(nugget=1000000,psill=6000000,model ="Exp",range = 40000),fit.method = 7)
Error in switch(model, exponential = fit.exponential(v.object, c0 = nugget,  :
  EXPR must be a length 1 vector
> traceback()
1: fit.variogram(c.vgm.exp, vgm(nugget = 1e+06, psill = 6e+06, model = "Exp",
       range = 40000), fit.method = 7)

Thanks and Regards,

Saubhagya Singh Rathore
1st Year Graduate Student
Civil and Environmental Engineering
Georgia Instutute of Technology

        [[alternative HTML version deleted]]

R-sig-Geo mailing list
[hidden email]