Entering edit mode
Kimpel, Mark W
▴
890
@kimpel-mark-w-727
Last seen 10.3 years ago
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