EVOLUTION-MANAGER
Edit File: inspect.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: Track the executed code lines of a function or method.</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 inspect {RUnit}"><tr><td>inspect {RUnit}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Track the executed code lines of a function or method.</h2> <h3>Description</h3> <p><code>inspect</code> examines and modifies the source code of a function or method. After the modification of the source code, the modified function will be executed and the result of the tracking process will be stored. To store the information a <code>tracker</code> environment with the name track must exist. Note, that not all R code constructs can be handled at the current state. In some cases it is not possible to track a specific code line. Therefore, clearly structured code with consequent use of opening and closing braces to indicate conditional expressions can prevent these parser problems. </p> <h3>Usage</h3> <pre> inspect(expr, track = track) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>Any R function or method call.</p> </td></tr> <tr valign="top"><td><code>track</code></td> <td> <p>list object, as returned by a call to <code>tracker</code>.</p> </td></tr> </table> <h3>Details</h3> <p>The return value of <code>inspect</code> is the result returned by the function executed. If the function has no return value nothing is returned either.</p> <h3>Author(s)</h3> <p>Thomas König, Klaus Jünemann & Matthias Burger</p> <h3>See Also</h3> <p><code><a href="tracker.html">tracker</a></code> for the call tracking object, and <code><a href="printHTML.trackinfo.html">printHTML.trackInfo</a></code> for displaying results. </p> <h3>Examples</h3> <pre> ## example function foo <- function(x){ y <- 0 for(i in 1:100) { y <- y + i } return(y) } ## the name track is necessary track <- tracker() ## initialize the tracker track$init() ## inspect the function ## res will collect the result of calling foo res <- inspect(foo(10), track = track) ## get the tracked function call info resTrack <- track$getTrackInfo() ## create HTML sites printHTML.trackInfo(resTrack) </pre> <hr /><div style="text-align: center;">[Package <em>RUnit</em> version 0.4.32 <a href="00Index.html">Index</a>]</div> </body></html>