Learn R Programming

bivarhr (version 0.1.5)

disc_terciles: Discretize Numeric Vector into Terciles

Description

Converts a numeric vector into an ordered factor with three levels (low, medium, high) using deterministic percent ranks to break ties.

Usage

disc_terciles(x)

Value

An ordered factor with levels "low", "medium", "high".

Arguments

x

Numeric vector to discretize.

Examples

Run this code
x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9)
disc_terciles(x)

Run the code above in your browser using DataLab