scale_to | R Documentation |
Rescales x
such that for the rescaled data it holds: mean(scale_to(x, mean=target))==target
and
sd(scale_to(x, sd=target)==abs(target)
. A negative value of sd
will change the sign of the x
values.
scale_to(x, mean = 0, sd = 1)
x |
numeric: vector of values |
mean |
numeric: mean of the rescaled |
sd |
numeric: standard deviation of the transformed |
Rescaled data.
x <- runif(50)
y <- scale_to(x, mean=0.1, sd=0.2)
mean(y)
sd(y)
y <- scale_to(x, mean=0.1, sd=-0.2)
mean(y)
sd(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.