I want to write the error from D%4 and move on. Mistake:
Error: unexpected input in "D%4"
Typically, if a function is called, the following works:
capture_warn_error <- function(x){ tryCatch({ x }, warning = function(w) { w }, error = function(e) { e }) } capture_warn_error(D%4)
But recovery is not possible, since `D% 4 immediately disables everything:
## > capture_warn_error(D%4) ## Error: unexpected input in "capture_warn_error(D%4)"
In any case, to capture such a stubborn beast and move on? I know that D%4 not an object, but this works for other non-objects:
capture_warn_error(means) ## <simpleError in doTryCatch(return(expr), name, parentenv, handler): object 'means' not found>
Nicely:
- Understand why
D%4 recovering vs means - Find a recovery method and capture
D%4 error
r
Tyler rinker
source share