Learn R Programming

exams.forge (version 1.0.10)

unique_max: Unique Maximum

Description

Checks if x has a unique maximum. The largest and the second largest value must have at least a distance of tol.

Usage

unique_max(x, tol = 0.001)

Value

Logical

Arguments

x

numeric: values to check

tol

numeric: minimum distance between the largest and the second largest value (default: 1e-3)

Examples

Run this code
x <-runif(100)
unique_max(x)
unique_max(x, tol=0.1)

Run the code above in your browser using DataLab