# set up arbitrary upper and lower-bounded vector
outcome <- runif(1000, min=-33, max=445)
# normalize to \[0,1\]
trans_outcome <- normalize(outcome=outcome)
summary(trans_outcome)
# only works with numeric vectors and factors
try(normalize(outcome=c('a','b')))
Run the code above in your browser using DataLab