ID EN
Function Utilities

browser

R Base 3.6.2

Interrupt the execution of an expression and allow the inspection of the environment where browser was called from.

Syntax

R
browser(text = "", condition = NULL, expr = TRUE, skipCalls = 0L)

Arguments

Parameter Description
text a text string that can be retrieved once the browser is invoked.
condition a condition that can be retrieved once the browser is invoked.
expr An expression, which if it evaluates to TRUE the debugger will invoked, otherwise control is returned directly.
skipCalls how many previous calls to skip when reporting the calling context.

Details

A call to browser can be included in the body of a function. When reached, this causes a pause in the execution of the current expression and allows access to the R interpreter. The purpose of the text and condition arguments are to allow helper programs (e.g., external debuggers) to insert specific values here, so that the specific call to browser (perhaps its location in a source file) can be identified and special processing can be achieved. The values can be retrieved by calling browserText and browserCondition. The purpose of the expr argument is to allow for the illusion of conditional debugging. It is an illusion, because execution is always paused at the call to browser, but control is only passed to the evaluator described below if expr evaluates to TRUE. In most cases it is going

See Also

debug and traceback for the stack on error. browserText for how to retrieve the text and condition.