[R] Error generated by nlme::gnls

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Sun Jul 24 13:03:02 CEST 2022


On Sun, 24 Jul 2022 07:58:01 +0300
Ivan Krylov <krylov.r00t using gmail.com> wrote:

> On Sun, 24 Jul 2022 16:03:24 +1200
> Rolf Turner <r.turner using auckland.ac.nz> wrote:
> 
> > My impression is that if the right hand side of a formula gets "too
> > long", then it gets split into parts --- which messes everything up.
> 
> For new enough R (≥ 4.0), it's possible to use deparse1() [*], which
> guarantees to return a single string. Otherwise, the simplest
> workaround would be paste(deparse(...), collapse = ' '), which is
> similar to how deparse1 is defined.
> 

Yes but .....

I guess my posting did not make things clear.  Sorry 'bout that! My
posting, and Ben Tupper's posting, were in response to an earlier
posting by Aaron Crowley which dealt with an error that now results
from a call to gnls(). Apparently the exact same call had worked
without error in the past.

The call to deparse(), which triggers the error, is in the code
of gnls().  (Line 223 of gnls.R.)

The maintainer of the nlme package (who is, according to maintainer(),
"R-core") could change the code so that it uses invokes deparse1()
rather than deparse, but the user cannot do so, not without in effect
re-creating the package.

Also, the question remains:  why did Aaron Crowley's code work in the
past, whereas now it throws an error?  What changed?

cheers,

Rolf Turner

P.S. Aaron Crowley tells us that he is currently running R 4.2.1.
However he did not tell us what version of R he was running at the time
("approximately six months ago") when the call to gnls() executed
successfully.  Perhaps that version was older than 4.0.  Even so, it's
all a bit mysterious.

R. T.

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-help mailing list