Complete the code to print the current call stack.
[1]()The traceback() function prints the current call stack in R, helping you see the sequence of function calls.
Complete the code to start debugging a function call.
debug([1])The debug() function in R sets a breakpoint on the specified function, here my_function, so you can step through it.
Fix the error in the code to stop debugging the function.
undebug([1])The undebug() function requires the function name without parentheses to stop debugging it.
Fill both blanks to print the last error message and then clear it.
print([1]()) [2]()
geterrmessage() prints the last error message, and calling it again resets the error message in R.
Fill all three blanks to run code with error handling and print a custom message.
tryCatch([1]("a"), error = function(e) { print(paste('Error:', [2])) [3]() })
tryCatch() runs log("a"). If an error occurs, it prints the error message e$message and then stops execution with stop().