| scale_to {exams.forge} | R Documentation |
Rescaling
Description
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.
Usage
scale_to(x, mean = 0, sd = 1)
Arguments
x |
numeric: vector of values |
mean |
numeric: mean of the rescaled |
sd |
numeric: standard deviation of the transformed |
Value
Rescaled data.
Examples
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)
[Package exams.forge version 1.0.10 Index]