percentileSelect

fun <T : Comparable<T>> List<T>.percentileSelect(p: Double, method: QuantileMethod = QuantileMethod.NEAREST): T(source)

Selects the element at the p-th percentile position from this sorted list.

This is a convenience wrapper around quantileSelect that accepts a percentile (0–100) instead of a quantile (0–1). See quantileSelect for details on supported methods and behavior.

Example:

listOf("a", "b", "c", "d", "e").percentileSelect(50.0) // "c"

Return

the element at the p-th percentile position.

Parameters

p

the percentile to compute, in 0, 100.

method

the non-interpolating quantile method. Defaults to QuantileMethod.NEAREST.