Description Usage Arguments Author(s) Examples
Rescale any numerical variable from min-max to 0-1.
1 | rescale(x, backward = F)
|
x |
|
backward |
Joost van de Weijer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, backward = F)
{
if (!backward)
structure((x - min(x, na.rm = T))/(max(x, na.rm = T) -
min(x, na.rm = T)), range = range(x, na.rm = T))
else structure(x * (attr(x, which = "range")[2] - attr(x,
which = "range")[1]) + attr(x, which = "range")[1], range = attr(x,
which = "range"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.