r scale vector between 0 and 1 code example
Example: r - scale data from 0 to 1
s = sort(rexp(100)) # Generate 100 values of exponential distribution
range01 <- function(x){(x-min(x))/(max(x)-min(x))} # Function MinMax Scaler
range01(s) # Calculate scaleing from 0 to 1