[R] Determining cause of error?

Charles C. Berry cberry at tajo.ucsd.edu
Thu Aug 14 06:30:03 CEST 2008


On Wed, 13 Aug 2008, rkevinburton at charter.net wrote:

> This is both a specific question and a general one. First, I am running 'fitdistr' from library(MASS) and I get the following:
>
> Error in fitdistr(templist, "weibull") : optimization failed
>
> What is the cause of the error? How can I tell? Can I just catch this 
> error, report it and move to the next set of data (eat the exception)?
>

You can use try() or tryCatch() to both allow further calculation and to 
save the current input to fitdistr() for further study.

Alternatively, you can set options(error=recover) - see ?recover - 
and see where the error comes from.

HTH,

Chuck


> Thank you.
>
> Kevin
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901



More information about the R-help mailing list