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