cpp11 icon indicating copy to clipboard operation
cpp11 copied to clipboard

Catch error from R function

Open mgirlich opened this issue 3 years ago • 0 comments
trafficstars

Is it possible to evaluate an R function and in case of an error catch the error condition and modify it?

For example I want to evaluate log() on x but x is the character "a"

auto log = cpp11::package("base")["log"];
log(x);

Can I catch the error with cpp11 and modify it or pass it to another R function?

mgirlich avatar Jul 28 '22 13:07 mgirlich