EVOLUTION-MANAGER
Edit File: mean.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: Arithmetic Mean</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 mean {base}"><tr><td>mean {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Arithmetic Mean</h2> <h3>Description</h3> <p>Generic function for the (trimmed) arithmetic mean. </p> <h3>Usage</h3> <pre> mean(x, ...) ## Default S3 method: mean(x, trim = 0, na.rm = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object. Currently there are methods for numeric/logical vectors and <a href="Dates.html">date</a>, <a href="DateTimeClasses.html">date-time</a> and <a href="difftime.html">time interval</a> objects. Complex vectors are allowed for <code>trim = 0</code>, only.</p> </td></tr> <tr valign="top"><td><code>trim</code></td> <td> <p>the fraction (0 to 0.5) of observations to be trimmed from each end of <code>x</code> before the mean is computed. Values of trim outside that range are taken as the nearest endpoint. </p> </td></tr> <tr valign="top"><td><code>na.rm</code></td> <td> <p>a logical value indicating whether <code>NA</code> values should be stripped before the computation proceeds.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Value</h3> <p>If <code>trim</code> is zero (the default), the arithmetic mean of the values in <code>x</code> is computed, as a numeric or complex vector of length one. If <code>x</code> is not logical (coerced to numeric), numeric (including integer) or complex, <code>NA_real_</code> is returned, with a warning. </p> <p>If <code>trim</code> is non-zero, a symmetrically trimmed mean is computed with a fraction of <code>trim</code> observations deleted from each end before the mean is computed. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="../../stats/html/weighted.mean.html">weighted.mean</a></code>, <code><a href="DateTimeClasses.html">mean.POSIXct</a></code>, <code><a href="colSums.html">colMeans</a></code> for row and column means. </p> <h3>Examples</h3> <pre> x <- c(0:10, 50) xm <- mean(x) c(xm, mean(x, trim = 0.10)) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>