powered by
is(x, "try-error")
is.error(x)
try
logical(1)
x <- try(stop("foo")) print(is.error(x)) x <- 1 print(is.error(x))
Run the code above in your browser using DataLab