RESCALE | R Documentation |
Rescale a vector to fit in a certain range
RESCALE(x, nx1=0, nx2=1, minx=0, maxx=1)
x |
vector |
nx1 |
new minimum |
nx2 |
new maximum |
minx |
old min |
maxx |
old max |
Rescaling a vector, mostly used for graphics. If x does not vary, i.e. it is constant or minx and max are identical, the mean value of nx1 and nx2 is returned.
Scale version of x vector is returned.
Jonathan M. Lees<jonathan.lees.edu>
x = rnorm(10)
RESCALE(x, 3, 9, min(x), max(x) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.