I am calling the uniroot function from inside another function using these
lines (last two lines of the function) :
d <- uniroot(k, c(.001, 250), tol=.05)
return(d$root)
The problem is that on occasion there's a problem with the values I'm
passing to uniroot. In those instances uniroot stops and sends a message
that it can't calculate the root because f.upper * f.lower is greater than
zero. All I'd like to do in those cases is be able to set the return value
of my calling function "return(d$root)" to .0001. But I'm not sure how to
pull that off. I tried a few modifications to uniroot but so far no luck.