newRange | R Documentation |
The newRange
function scales a numeric vector to a new range as defined by
minimum and maximum extreme values.
newRange(x, new.min = 0, new.max = 1)
x |
a numeric vector |
new.min |
numeric value of new minimum range value |
new.max |
numeric value of new maximum range value |
y <- runif(100, min=0, max=2) y2 <- newRange(y, new.min=0, new.max=1) plot(y, t="l") lines(y2, col=2) plot(y, y2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.