powered by
rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE))
x
rescale(1:100) rescale(runif(50)) rescale(1)
Run the code above in your browser using DataLab