EVOLUTION-MANAGER
Edit File: recover.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Browsing after an Error</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for recover {utils}"><tr><td>recover {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Browsing after an Error</h2> <h3>Description</h3> <p>This function allows the user to browse directly on any of the currently active function calls, and is suitable as an error option. The expression <code>options(error = recover)</code> will make this the error option. </p> <h3>Usage</h3> <pre> recover() </pre> <h3>Details</h3> <p>When called, <code>recover</code> prints the list of current calls, and prompts the user to select one of them. The standard <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> <code><a href="../../base/html/browser.html">browser</a></code> is then invoked from the corresponding environment; the user can type ordinary <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> language expressions to be evaluated in that environment. </p> <p>When finished browsing in this call, type <code>c</code> to return to <code>recover</code> from the browser. Type another frame number to browse some more, or type <code>0</code> to exit <code>recover</code>. </p> <p>The use of <code>recover</code> largely supersedes <code><a href="debugger.html">dump.frames</a></code> as an error option, unless you really want to wait to look at the error. If <code>recover</code> is called in non-interactive mode, it behaves like <code>dump.frames</code>. For computations involving large amounts of data, <code>recover</code> has the advantage that it does not need to copy out all the environments in order to browse in them. If you do decide to quit interactive debugging, call <code><a href="debugger.html">dump.frames</a></code> directly while browsing in any frame (see the examples). </p> <h3>Value</h3> <p>Nothing useful is returned. However, you <em>can</em> invoke <code>recover</code> directly from a function, rather than through the error option shown in the examples. In this case, execution continues after you type <code>0</code> to exit <code>recover</code>. </p> <h3>Compatibility Note</h3> <p>The <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> <code>recover</code> function can be used in the same way as the S function of the same name; therefore, the error option shown is a compatible way to specify the error action. However, the actual functions are essentially unrelated and interact quite differently with the user. The navigating commands <code>up</code> and <code>down</code> do not exist in the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> version; instead, exit the browser and select another frame. </p> <h3>References</h3> <p>John M. Chambers (1998). <em>Programming with Data</em>; Springer. <br /> See the compatibility note above, however. </p> <h3>See Also</h3> <p><code><a href="../../base/html/browser.html">browser</a></code> for details about the interactive computations; <code><a href="../../base/html/options.html">options</a></code> for setting the error option; <code><a href="debugger.html">dump.frames</a></code> to save the current environments for later debugging. </p> <h3>Examples</h3> <pre> ## Not run: options(error = recover) # setting the error option ### Example of interaction > myFit <- lm(y ~ x, data = xy, weights = w) Error in lm.wfit(x, y, w, offset = offset, ...) : missing or negative weights not allowed Enter a frame number, or 0 to exit 1:lm(y ~ x, data = xy, weights = w) 2:lm.wfit(x, y, w, offset = offset, ...) Selection: 2 Called from: eval(expr, envir, enclos) Browse[1]> objects() # all the objects in this frame [1] "method" "n" "ny" "offset" "tol" "w" [7] "x" "y" Browse[1]> w [1] -0.5013844 1.3112515 0.2939348 -0.8983705 -0.1538642 [6] -0.9772989 0.7888790 -0.1919154 -0.3026882 Browse[1]> dump.frames() # save for offline debugging Browse[1]> c # exit the browser Enter a frame number, or 0 to exit 1:lm(y ~ x, data = xy, weights = w) 2:lm.wfit(x, y, w, offset = offset, ...) Selection: 0 # exit recover > ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>