I have an asymetrical distribution :
x <- c(rnorm(100, 0, 1),
rnorm(100, 2.5, 0.5))
I would like to shift it so the old "0" value is now 100 and the old "2" value is now "15". However, I would like to do it without using old nor new min/max values.
Using the scale
function is not appropriated as it shifts the mean to an new value, and I'd like to shift a specific value to a new one. I can't make rescale
do it neither.
plot(density(scale(x)*15+100))
plot(density(scales::rescale(x, from=c(0, 2), to=c(100, 15))))