EVOLUTION-MANAGER
Edit File: median.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: Median Value</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 median {stats}"><tr><td>median {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Median Value</h2> <h3>Description</h3> <p>Compute the sample median. </p> <h3>Usage</h3> <pre> median(x, na.rm = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed.</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>potentially further arguments for methods; not used in the default method.</p> </td></tr> </table> <h3>Details</h3> <p>This is a generic function for which methods can be written. However, the default method makes use of <code>is.na</code>, <code>sort</code> and <code>mean</code> from package <span class="pkg">base</span> all of which are generic, and so the default method will work for most classes (e.g., <code>"<a href="../../base/html/Dates.html">Date</a>"</code>) for which a median is a reasonable concept. </p> <h3>Value</h3> <p>The default method returns a length-one object of the same type as <code>x</code>, except when <code>x</code> is logical or integer of even length, when the result will be double. </p> <p>If there are no values or if <code>na.rm = FALSE</code> and there are <code>NA</code> values the result is <code>NA</code> of the same type as <code>x</code> (or more generally the result of <code>x[FALSE][NA]</code>). </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="quantile.html">quantile</a></code> for general quantiles.</p> <h3>Examples</h3> <pre> median(1:4) # = 2.5 [even number] median(c(1:3, 100, 1000)) # = 3 [odd, robust] </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>