Debugging
Theory
message
just a generic notification as messagewarning
something could go wrongerror
fatal error that stops executioncondition
generic concept indicating something unexpected happened
Functions
traceback
prints out the function call stack tracedebug
flags function for debug modebrowser
suspends execution and starts function in debugtrace
allows insert debugging code into a functionrecover
allows to modify error behavior so function stact trace can be browsed
Examples
traceback
> mean(x)
Error in mean(x) : object 'x' not found
> traceback()
1: mean(x)
debug
> debug(lm)
> lm (y- x)
debugging in: lm(y - x)
And you continue to debugging window.
recover
> options(error=recover)
> read.csv("donotexitfile")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'donotexitfile': No such file or directory
Enter a frame number, or 0 to exit
1: read.csv("donotexitfile")
2: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec, fill = fill, comment.char = comment.char, ...)
3: file(file, "rt")
Last updated
Was this helpful?