dump.frames
Save All Frames on Errors
Description
Specify how to create the last.dump object for future debugging when an error occurs.
Usage
dump.frames(dumpto = "last.dump", to.file = FALSE, include.GlobalEnv = FALSE)
Arguments
dumpto |
the name of the object in which to save the evaluation frames.
|
to.file |
A logical value. If TRUE then the dumpto object
created by this function will be saved (using the save function)
as a file called paste(dumpto, "rda", sep=".").
Another TIBCO Enterprise Runtime for R or R process can use load to load (using the load
function) and analyze the frames in it.
Otherwise the object will be created in the global environment.
|
include.GlobalEnv |
A logical value. If TRUE then include the global environment at the
top of the list of dumped frames. Otherwise dump only the function call frames.
|
Details
Function dump.frames stores a list of all the currently active evaluation frames.
The names on the list represent the function calls that created the frames.
You can use with in the various frames to look at the value of variables.
Side Effects
Usually, an object named in dumpto ("last.dump" by default) is created.
If to.file is TRUE then a file is created.
Background
This function is typically used as an error action, options(error=dump.frames),
so the state of the system can be stored when an error occurs. Storing to a file is
useful when you are not running TIBCO Enterprise Runtime for R interactively and want to be able to debug problems.
See Also
Examples
## Not run:
options(error=expression(dump.frames()))
# Error in lm, no cars with Disp. > 400:
fit <- lm(Mileage ~ HP, subset=Disp. > 400, data=Sdatasets::car.all)
options(error=NULL)
i <- menu(names(last.dump)) # choose "lm.fit(x = X..."
with(last.dump[[i]], str(x)) # look at structure of x in that frame
## End(Not run)