median {stats} | R Documentation |
Compute the sample median of the vector of values given as its argument.
median(x, na.rm = FALSE)
x |
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. |
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
quantile
for general quantiles.
median(1:4)# = 2.5 [even number] median(c(1:3,100,1000))# = 3 [odd, robust]