Learn R Programming

unbalhaar (version 2.1)

med: Median

Description

The function computes the median of a vector. Unlike median, it is guaranteed to return a value which is a component of the input vector.

Usage

med(x)

Arguments

x

a vector

Value

a scalar defined as quantile(x, .5, type=3)[[1]]

Examples

Run this code
# NOT RUN {
med(1:4)
median(1:4)
# }

Run the code above in your browser using DataLab