Reputation: 1310
I want to know if there is the possibility to create a log with the information of the "error" that force the tryCatch to do "error handling"? Is to be able to gain visibility of potential errors. I want to avoid doing prints. Thanks!
Upvotes: 0
Views: 1742
Reputation: 1355
this will work:
outputFile <-file("output.txt")
tryCatch({
--- your code ---
}, error = function(e) {
writeLines(as.character(e), outputFile)
})
-----------------------------
close(outputFile)
Upvotes: 4