n_dist2ref {COINr} | R Documentation |
A measure of the distance to a specific value found in x
, specified by iref
. The formula is:
n_dist2ref(x, iref, cap_max = FALSE)
x |
A numeric vector |
iref |
An integer which indexes |
cap_max |
If |
1 - (x_{ref} - x)/(x_{ref} - x_{min})
Values exceeding x_ref
can be optionally capped at 1 if cap_max = TRUE
.
Numeric vector
x <- runif(20)
n_dist2ref(x, 5)