[R] Error: promise already under evaluation

Joseph Lucke j||ucke48 @end|ng |rom gm@||@com
Tue Jul 18 20:23:57 CEST 2023


Fixed!
I was not passing a tol value from the outer function to the inner
qnbinom() function. Because the scope of tol in qbinom() was confined to
the outer function, qnbinom was not accessing the globally defined tol
value. Furthermore, because the outer function itself was embedded in
integrate(), the standard nonstandard scoping didn't enable access to the
global value.
I hope this makes sense.
In any case, the problem has been solved.
Thanks.

On Tue, Jul 18, 2023, 10:38 AM Ivan Krylov <krylov.r00t using gmail.com> wrote:

> В Tue, 18 Jul 2023 09:28:30 -0400
> Joseph Lucke <jflucke48 using gmail.com> пишет:
>
> > Error in qnbinom(1 - tol, size = q, prob = r) :
>
> > pRsq.Rhosq <- function(x, n, p, Rhosq,tol=tol){
>
> It looks like you're not passing the `tol` parameter, and its default
> value unfortunately refers to itself:
>
> (function(x = x) x)()
> # Error in (function(x = x) x)() :
> #   promise already under evaluation: recursive default argument
> #   reference or earlier problems?
>
> --
> Best regards,
> Ivan
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list