How can you get the original values after applying scale()
to a vector?
x <- c(11, 12, 13,24, 25, 16, 17, 18, 19)
scaled <- scale(x)
You may use attributes
x <- c(11, 12, 13,24, 25, 16, 17, 18, 19)
y <- scale(x)
z <- attributes(y)
y * (z$'scaled:scale') + z$'scaled:center'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With