EVOLUTION-MANAGER
Edit File: profvis.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: Profile an R expression and visualize profiling data</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 profvis {profvis}"><tr><td>profvis {profvis}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Profile an R expression and visualize profiling data</h2> <h3>Description</h3> <p>This function will run an R expression with profiling, and then return an htmlwidget for interactively exploring the profiling data. </p> <h3>Usage</h3> <pre> profvis( expr = NULL, interval = 0.01, prof_output = NULL, prof_input = NULL, width = NULL, height = NULL, split = c("h", "v"), torture = 0, simplify = TRUE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>Code to profile. Not compatible with <code>prof_input</code>.</p> </td></tr> <tr valign="top"><td><code>interval</code></td> <td> <p>Interval for profiling samples, in seconds. Values less than 0.005 (5 ms) will probably not result in accurate timings</p> </td></tr> <tr valign="top"><td><code>prof_output</code></td> <td> <p>Name of an Rprof output file or directory in which to save profiling data. If <code>NULL</code> (the default), a temporary file will be used and automatically removed when the function exits. For a directory, a random filename is used.</p> </td></tr> <tr valign="top"><td><code>prof_input</code></td> <td> <p>The path to an <code><a href="../../utils/html/Rprof.html">Rprof</a></code> data file. Not compatible with <code>expr</code> or <code>prof_output</code>.</p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p>Width of the htmlwidget.</p> </td></tr> <tr valign="top"><td><code>height</code></td> <td> <p>Height of the htmlwidget</p> </td></tr> <tr valign="top"><td><code>split</code></td> <td> <p>Direction of split. Either <code>"v"</code> (the default) for vertical, or <code>"h"</code> for horizontal. This is the orientation of the split bar.</p> </td></tr> <tr valign="top"><td><code>torture</code></td> <td> <p>Triggers garbage collection after every <code>torture</code> memory allocation call. </p> <p>Note that memory allocation is only approximate due to the nature of the sampling profiler and garbage collection: when garbage collection triggers, memory allocations will be attributed to different lines of code. Using <code>torture = steps</code> helps prevent this, by making R trigger garbage collection after every <code>torture</code> memory allocation step.</p> </td></tr> <tr valign="top"><td><code>simplify</code></td> <td> <p>Whether to simplify the profiles by removing intervening frames caused by lazy evaluation. This only has an effect on R 4.0. See the <code>filter.callframes</code> argument of <code><a href="../../utils/html/Rprof.html">Rprof</a>()</code>.</p> </td></tr> </table> <h3>Details</h3> <p>An alternate way to use <code>profvis</code> is to separately capture the profiling data to a file using <code><a href="../../utils/html/Rprof.html">Rprof</a>()</code>, and then pass the path to the corresponding data file as the <code>prof_input</code> argument to <code>profvis()</code>. </p> <h3>See Also</h3> <p><code><a href="print.profvis.html">print.profvis</a></code> for printing options. </p> <p><code><a href="../../utils/html/Rprof.html">Rprof</a></code> for more information about how the profiling data is collected. </p> <h3>Examples</h3> <pre> # Only run these examples in interactive R sessions if (interactive()) { # Profile some code profvis({ dat <- data.frame( x = rnorm(5e4), y = rnorm(5e4) ) plot(x ~ y, data = dat) m <- lm(x ~ y, data = dat) abline(m, col = "red") }) # Save a profile to an HTML file p <- profvis({ dat <- data.frame( x = rnorm(5e4), y = rnorm(5e4) ) plot(x ~ y, data = dat) m <- lm(x ~ y, data = dat) abline(m, col = "red") }) htmlwidgets::saveWidget(p, "profile.html") # Can open in browser from R browseURL("profile.html") } </pre> <hr /><div style="text-align: center;">[Package <em>profvis</em> version 0.3.7 <a href="00Index.html">Index</a>]</div> </body></html>