Skip to contents

A function to return the cumulative median of a vector.

Usage

cmedian(.x)

Arguments

.x

A numeric vector

Value

A numeric vector

Details

A function to return the cumulative median of a vector.

Author

Steven P. Sanderson II, MPH

Examples

x <- mtcars$mpg

cmedian(x)
#>  [1] 21.00 21.00 21.00 21.20 21.00 21.00 21.00 21.00 21.00 21.00 21.00 20.10
#> [13] 19.20 18.95 18.70 18.40 18.10 18.40 18.70 18.95 19.20 18.95 18.70 18.40
#> [25] 18.70 18.95 19.20 19.20 19.20 19.20 19.20 19.20