Learn R Programming

nlmixr2auto (version 1.0.0)

rank_new: Ranking with significance difference threshold

Description

Performs a custom ranking of a numeric vector,and ajusts the ranks of values that differ by less than a specified threshold, ensuring they receive the same rank.

Usage

rank_new(x1, diff_tol)

Value

A numeric vector representing the adjusted ranks of the input values.

Arguments

x1

A numeric vector to be ranked.

diff_tol

A numeric value specifying the significance difference threshold. Values within this threshold are considered equal and receive the same rank.

Author

Zhonghui Huang

Examples

Run this code
x1 <- c(10, 20, 20.5, 30)
diff_tol <- 1
ranked_list <- rank_new(x1, diff_tol)
print(ranked_list)

Run the code above in your browser using DataLab