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