If a warning or error occurs, I would like to print the name of the function generating the error.
tryCatch in R allows one to handle errors in a function call, perhaps it is part of the solution? For example, this could be in a context like:
handleErr <-function(e) {
print("you had an error in function:")
print( WHAT CAN I PUT HERE??! )
}
tryCatch( myFunction(), error=handleErr )