Skip to contents

This function computes the *median*.

Usage

midpoint(x, i = NULL, na.rm = T, ...)

Arguments

x

(named) numerical vector

i

(optional) numerical vector giving the position in x or character vector matching the names in x. If missing or i = NULL, the entire x is considered for the computation of the score

na.rm

logical, whether to remove NA values from x before computation

...

further arguments to median

Value

A numerical value representing the computed measure. A default NA value is returned if the score can't be computed.

Details

It is a wrapper to median function.

Author

Alessandro Barberis

Examples

x = c(seq_len(length.out = 10), NA)
midpoint(x = x, na.rm = TRUE)
#> [1] 5.5