[BioC] error handling in R

Kimpel, Mark W mkimpel at iupui.edu
Mon May 10 21:11:44 CEST 2004


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



More information about the Bioconductor mailing list