find.kth.element: Quickly finds the k'th largest element in a (large) vector

Description Usage Arguments Value Examples

Description

Quickly finds the k'th largest element in a (large) vector

Usage

1

Arguments

x

Numeric vector.

k

Integer with the rank of the desired element.

Value

numeric k'th largest element

Examples

1
2
3
y <- rnorm(1e3)
           stopifnot(identical(y[order(y,decreasing=TRUE)[100]],
                               find.kth.element(y,100)))

DNAprofiles documentation built on Jan. 15, 2017, 9:27 p.m.