Rev 42333 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/browser.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{browser}\alias{browser}\title{Environment Browser}\description{Interrupt the execution of an expression and allow the inspection ofthe environment where \code{browser} was called from.}\usage{browser()}\details{A call to \code{browser} can be included in the body of a function.When reached, this causes a pause in the execution of thecurrent expression and allows access to the \R interpreter.At the browser prompt the user can enter commands or \R expressions.The commands are\describe{\item{\code{c}}{(or just return) exit the browser and continueexecution at the next statement.}\item{\code{cont}}{synonym for \code{c}.}\item{\code{n}}{enter the step-through debugger. This changes themeaning of \code{c}: see the documentation for \code{\link{debug}}.}\item{\code{where}}{print a stack trace of all active function calls.}\item{\code{Q}}{exit the browser and the current evaluation andreturn to the top-level prompt.}}(Leading and trailing whitespace is ignored, except for return).Anything else entered at the browser prompt is interpreted as an\R expression to be evaluated in the calling environment: inparticular typing an object name will cause the object to be printed,and \code{ls()} lists the objects in the calling frame. (If you wantto look at an object with a name such as \code{n}, print itexplicitly.)The number of lines printed for the deparsed call can be limited bysetting \code{\link{options}(deparse.max.lines)}.}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth \& Brooks/Cole.Chambers, J. M. (1998)\emph{Programming with Data. A Guide to the S Language}.Springer.}\seealso{\code{\link{debug}}, and\code{\link{traceback}} for the stack on error.}\keyword{programming}\keyword{environment}