System Evaluator State

DESCRIPTION:
Return information on the current memory frames.

USAGE:
sys.call(which=<<see below>>)
sys.frame(which=<<see below>>)
sys.nframe()
sys.function(n=<<see below>>)
sys.parent(n=1)

sys.calls() sys.frames() sys.parents() sys.on.exit()

sys.status()


OPTIONAL ARGUMENTS:
which:
the frame number.
n:
the number of frame generations to go back.

VALUE:
The current frame:

sys.call returns the actual call for frame which. By default, which is the frame in which the call to sys.call is made.

sys.frame returns the list of objects in frame which. By default, which is the frame in which the call to sys.call is made.

sys.nframe returns the numerical index of the current frame in the list of all frames.

sys.function returns the definition of the function being called in frame n (the current frame by default).

sys.parent returns the index in the list of frames of the parent (i.e., the caller) of the current function. The argument to sys.parent says how many generations to go back (by default, to the caller of the caller of sys.parent).

All frames:

sys.calls returns the list of the function calls that generated the frames.

sys.frames is the list of the frames themselves (i.e., each component is a list giving the named objects in that frame, including the matched arguments in the call).

sys.parents gives the indices of the parent frames of each of the frames.

sys.on.exit is the list of expressions given to on.exit and currently still scheduled to be evaluated on exit from the corresponding frame.

sys.status returns the complete internal evaluator status; that is, everything above.


DETAILS:
These functions all return various objects describing the current state of the S-PLUS evaluator, in terms analogous to the model described in chapter 11 of Becker, Chambers and Wilks. The first four functions describe the current frame (the function call from which, e.g., sys.call was called). Most of the remaining functions describe the list of all frames that are currently open in the evaluator.

NOTE:
Use frame to advance the graphics frame.

SEE ALSO:
trace.on for sys.trace , frame.attr .

EXAMPLES:
# remove an object from my own local frame
        remove("xxx",frame = sys.nframe())

myplot <- function(x, y) { the.call <- sys.call() xname <- deparse(the.call[[2]]) yname <- deparse(the.call[[3]]) plot(x, y, xlab = xname, ylab = yname) return(list(call = the.call)) }