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

Bert Gunter bgunter.4567 at gmail.com
Sun Sep 24 23:02:09 CEST 2017

No reproducible example makes it difficult to diagnose the source of the

Did you try using traceback() after the error? That might give you a hint.

I am unfamiliar with the package and function, but check the "range"
argument to make sure it's supposed to be a single value and not a vector
(just a wild guess on my party -- therefore likely wrong).


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Sun, Sep 24, 2017 at 1:12 PM, Rathore, Saubhagya Singh <
saubhagya at gatech.edu> wrote:

> Dear Members,
> I am trying to fit a variogram model using fit.variogram function from the
> gstat package. The figure showing my experimental variogram can be seen
> here: https://i.stack.imgur.com/UZXw4.png
> My code line for this operation is:
> > c2.vgm.fit<-fit.variogram(c2.vgm.exp,vgm(nugget=0,
> psill=400,model="Exp",range =40000),fit.method = 7)
> The system throws following error message:
> Error in switch(model, exponential = fit.exponential(v.object, c0 =
> nugget,  :
>   EXPR must be a length 1 vector
> Any help to know the cause of the error and avoiding it would be highly
> appreciated.
> Thank you very much
> Saubhagya Singh Rathore
> PhD Candidate
> Civil and Environmental Engineering
> Georgia Institute of Technology
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list