Learn R Programming

lshorth (version 0.1-6)

lshorth: Length of the Shorth

Description

For each data point, calculate the length of the shortest interval containing the point and covering a fraction p of the data.

Usage

lshorth(x, probs = NULL, plot = TRUE, na.rm=FALSE, ...)

Arguments

x
a vector of values for which the shorth length is to be computed.
probs
numeric vector of coverage probabilities with values in $[0,1]$.
plot
logical. If TRUE (default), the length of the shorth is plotted.
na.rm
logical; if TRUE, missing values are removed from x. If FALSE, any missing values cause an error.
...
additional arguments passed to plot

Value

an object of class "lshorth"
x
sorted vector of data
lshorth
matrix of shorth length
probs
vector of coverage probabilities. If probs is not given, a dyadic scale is used based on the sample length.

See Also

plot.lshorth,

Examples

Run this code
## shorth plot of normal variates
lshorth(rnorm(50))

Run the code above in your browser using DataLab