EVOLUTION-MANAGER
Edit File: zapsmall.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: Rounding of Numbers: Zapping Small Ones to Zero</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 zapsmall {base}"><tr><td>zapsmall {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Rounding of Numbers: Zapping Small Ones to Zero</h2> <h3>Description</h3> <p><code>zapsmall</code> determines a <code>digits</code> argument <code>dr</code> for calling <code>round(x, digits = dr)</code> such that values close to zero (compared with the maximal absolute value) are ‘zapped’, i.e., replaced by <code>0</code>. </p> <h3>Usage</h3> <pre> zapsmall(x, digits = getOption("digits")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a numeric or complex vector or any <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> number-like object which has a <code><a href="Round.html">round</a></code> method and basic arithmetic methods including <code><a href="Log.html">log10</a>()</code>.</p> </td></tr> <tr valign="top"><td><code>digits</code></td> <td> <p>integer indicating the precision to be used.</p> </td></tr> </table> <h3>References</h3> <p>Chambers, J. M. (1998) <em>Programming with Data. A Guide to the S Language</em>. Springer. </p> <h3>Examples</h3> <pre> x2 <- pi * 100^(-1:3) print(x2 / 1000, digits = 4) zapsmall(x2 / 1000, digits = 4) zapsmall(exp(1i*0:4*pi/2)) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>