To add to this, I am re-running code that I believe worked in July 2020 but now throws this same error. When I seek power as the answer (by leaving it NULL), wp.crt2arm works fine, but if I'm running it looking for J, then it gives this interval error.
I'm not sure exactly what function is being solved by nuniroot under the hood, so I don't know what interval it should search for this root. If I attempt to specify an interval it still returns the same error (even if I try very different intervals):
> wp.crt2arm(f = effect, n = 800, J=NULL, icc = 0.06, alpha = alpha, power = 0.8, interval=c(0,1))
Error in nuniroot(function(J) eval(p.body) - power, ifelse(is.null(interval), :
Please provide an interval with two values such as c(0,1).
The three-arm version seems to run fine, e.g.
wp.crt3arm(f = effect, n = 40, icc = 0.06, alpha = alpha, power = 0.8, type = c("main"))