How to Compute the Median

Example Data 244 238
Webform
The Drupal File ID of the selected dataset. The user may load another using the search bar on the operation's page.
Help

Median Value

Description

Compute the sample median.

Usage

median(x, na.rm = FALSE, ...)

Arguments

x

an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

...

potentially further arguments for methods; not used in the default method.

Value

The default method returns a length-one object of the same type as x, except when x is logical or integer of even length, when the result will be double.

If there are no values or if na.rm = FALSE and there are NA values the result is NA of the same type as x (or more generally the result of x[FALSE][NA]).

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Category

From Around the Site...

Title Authored on Content type
R Dataset / Package HistData / CushnyPeebles March 9, 2018 - 1:06 PM Dataset
R Dataset / Package Ecdat / nkill.byCountryYr March 9, 2018 - 1:06 PM Dataset
R Dataset / Package HistData / Snow.streets March 9, 2018 - 1:06 PM Dataset
R Dataset / Package MASS / steam March 9, 2018 - 1:06 PM Dataset
R Dataset / Package geepack / sitka89 March 9, 2018 - 1:06 PM Dataset