powered by
Checks if x has a unique maximum. The largest and the second largest value must have at least a distance of tol.
x
tol
unique_max(x, tol = 0.001)
Logical
numeric: values to check
numeric: minimum distance between the largest and the second largest value (default: 1e-3)
1e-3
x <-runif(100) unique_max(x) unique_max(x, tol=0.1)
Run the code above in your browser using DataLab