[BioC] error handling in R

A.J. Rossini rossini at blindglobe.net
Mon May 10 21:18:17 CEST 2004

Look at the try() function.

"Kimpel, Mark W" <mkimpel at iupui.edu> writes:

> A function I am calling from within one of my functions occasionally
> returns an error (bug in the other function, not my fault). When this
> happens, I would like for the value of the function that is blowing up
> to be "NA". Instead, my whole function blows up. 
> Is there a way I can do something like this?
> my.function(x)
> {
> if (is.error(function.someone.else(x))) {NA} else
> {function.someone.else(x)}
> }
> Unfortunately, R doesn't seem to provide for this "is.error" approach.
> Is there another answer?
> Thanks,
> Mark
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor

rossini at u.washington.edu            http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN          Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

More information about the Bioconductor mailing list