relative_position: Relative Position

Description Usage Arguments Details Examples

Description

Scale a vector of values to the range [0, 1] based on rank/position

Usage

1

Arguments

vals

vector of values

Details

Values are ranked and then scaled to the range [0, 1]. Ties result in the same relative position (e.g. relative_position(c(1, 2, 2, 3)) returns the vector c(0.0 0.5 0.5 1.0)). NAs remain as NAs.

Examples

1
2
3

mltools documentation built on May 2, 2019, 5:22 a.m.