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()
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.
# 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)) }