shorth {genefilter} | R Documentation |
Calculate the midpoint of the shorth
shorth(x, na.rm=FALSE, tieLimit=0.05)
x |
Numeric |
na.rm |
Logical |
tieLimit |
Numeric |
The shorth is the shortest interval that covers half of the
values in x
. Its midpoint is the median of the data values
that lie in the shorth and can be used as an
estimator of the mode of the distribution that generated x
.
An error is generated if there are multiple shortest intervals whose
start indices differ by more than a fraction tieLimit
of the
length of x
.
The midpoint of the short of x
.
Wolfgang Huber http://www.ebi.ac.uk/huber
x <- c(rnorm(100), runif(100) * 10) mean(x) median(x) shorth(x)