Re: [R] How do I modify uniroot function to return .0001 if error ?

2011-04-03 Thread Hans W Borchers
eric aol.com> writes: > > 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 uni

[R] How do I modify uniroot function to return .0001 if error ?

2011-04-03 Thread eric
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