powered by
Trim a vector so that all values are greater than 0 and less than 1.
trim_01(x)
A trimmed version of x
x
A numeric vector. Can be an rvec.
If
min is lowest element of x that is higher than 0, and
min
max is the highest element of x that is lower than 1, then trim_01()
max
trim_01()
shifts all elements of x that are lower than min upwards, so that they equal min, and
shifts all elements of x that are higher than max downwards, so that they equal max.
logit(), invlogit() Logit transformation
logit()
invlogit()
x <- c(1, 0.98, -0.001, 0.5, 0.01) trim_01(x)
Run the code above in your browser using DataLab