I want to extract the name of the function used from the error. Therefore, if I had:
mean(letters) "P" * 5
I want to extract "mean.default" and "*" . I can get a call from the error as follows:
capturer <- function(x){ tryCatch({ x }, warning = function(w) { w }, error = function(e) { e }) } capturer(mean(letters))$call
But you have no way to capture function names.
source share