

   debug {base}                                 R Documentation

   DDeebbuugg aa ffuunnccttiioonn

   DDeessccrriippttiioonn::

        Set or unset the debugging flag on a function.

   UUssaaggee::

        debug(fun)
        undebug(fun)

   AArrgguummeennttss::

        fun: any interpreted R function.

   DDeettaaiillss::

        When a function flagged for debugging is entered, nor-
        mal execution is suspended and the body of function is
        executed one statement at a time.  A new browser con-
        text is initiated for each step (and the previous one
        destroyed).  Currently you can only debug functions
        that have bodies enclosed in braces.  This is a bug and
        will be fixed soon.  You take the next step by typing
        carriage return, `n' or `next'.  You can see the values
        of variables by typing their names.  Typing `c' or
        `cont' causes the debugger to continue to the end of
        the function.  You can `debug' new functions before you
        step in to them from inside the debugger.  Typing `Q'
        quits the current execution and returns you to the top-
        level prompt.  If you have variables with names that
        are identical to the controls (eg. `c' or `n' ) then
        you need to use `print(c)' and `print(n)' to evaluate
        them.

   SSeeee AAllssoo::

        `browser', `traceback' to see the stack after an
        `Error: ...' message.

