Allows the user to inspect the contents of an object or function frame.
This function is an S Version 3 generic (see Methods);
method functions can be written to handle specific
S Version 3 classes of data. Classes which already
have methods for this function include:
tree
.
USAGE:
browser(object, ...)
OPTIONAL ARGUMENTS:
object
an integer, specifying one of the current evaluation frames, or
a S-PLUS object.
If no arguments are given,
browser.default browses in
the evaluation frame from which
browser is called.
...
methods may have additional arguments.
SIDE EFFECTS:
S-PLUS is put into a special state that allows browsing.
Normally
browser() is called within
a function; then running that function allows you to explore the behavior
inside that function. To exit that call to the browser
type
q, or to exit everything
type
stop. For further details
of normal use see
.
When the browser is called with an integer argument, or no argument,
it has direct access to a frame in the evaluator.
Assignments and replacements have a lasting effect in that frame
after the browser exits.
This allows interactive change to the behavior of a function; be
sure that is what you mean if you do assignments under these
conditions.
Note that read-only access to a frame in the evaluator is obtained by
browser(sys.frame(n))
which invokes the browser on a copy of the
n-th frame.
For further details and explicit control of this
feature, see
browser.default.
DETAILS:
The
browser methods allow the user to explore and possibly change
an object or function frame.
SEE ALSO:
,
,
,
,
,
.
EXAMPLES:
trace(foo, browser)
options(interrupt=browser)
myfun <- function(x,y) {
# lots of computing
browser() #now check things just before the moment of truth
.C("myroutine",x,y,w)
}