inspect(x, error.action=<<see below>>)
A few objects are also created in the local frames of functions entered, tracked, or marked. These have names which are unlikely to cause conflicts. However, their presence may break code which relies on the number of local objects.
The number of the frame in which a function is evaluated will differ from what it is under normal evaluation. But the relative frame parentage is preserved, of course.
Output produced by inspect appears on the standard output, and is therefore vulnerable to redirection with sink.
The instruction help prints a complete list of instructions, an excerpt of which is included below. The syntax and a detailed description of each is available with help <instruction>.
The default error.action starts a restricted version of the inspect shell on error, which allows examination of the state of the evaluator at the time of the error. You may examine frame and database objects, move among extant frames, and evaluate S-PLUS expressions you type in. Use quit to return to the top-level S-PLUS prompt.
Overview of instructions: Advance evaluation: step - walk through expressions complete - a loop or function resume - continue evaluation to next mark enter - descend into a function call quit - abandon inspect()
Display: where - print current function calls and current expression objects - names of objects in the local frame find - the location of an S-PLUS object show - installed tracks and marks
Halt evaluation; track functions: mark, unmark - arrange to stop in a function or at an expression track, untrack - install/change/remove function call reporting
Examine other current frames: up, down
Miscellaneous: eval - evaluate S-PLUS expressions you type in help - print instruction syntax and description
inspect(f(x)) my.error.function <- function() cat("This is called on error.\n") inspect(f(x), my.error.function)