median {math} R Documentation

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. [as boolean]

Details

This is a generic function for which methods can be written. However, the default method makes use of is.na, sort and mean from package base all of which are generic, and so the default method will work for most classes (e.g., "Date") for which a median is a reasonable concept.

Authors

SMRUCC genomics Institute

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]).

clr value class

Examples


[Package math version 2.33.856.6961 Index]