Description Usage Arguments Details Value Author(s) Examples
internal function: xscale
1 |
x |
numeric vector to be transformed |
torange |
new range |
xrange |
optional. full range of x vector if you are scaling only part of it. calculated from x if not supplied. |
Linear transformation to map x to a new range, so min(x)==xrange[1], and max(x)==xrange[2]
transformed numeric vector
Chris Wallace
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | x<-1:10
cbind(x,
GUESSFM:::xscale(x,c(0.1,1)),
GUESSFM:::xscale(x,c(1319,20578)))
## Now use only part of x
x<-x[2:7]
## WRONG
cbind(x,
GUESSFM:::xscale(x,c(0.1,1)),
GUESSFM:::xscale(x,c(1319,20578)))
## RIGHT
cbind(x,
GUESSFM:::xscale(x,c(0.1,1),xrange=c(1,10)),
GUESSFM:::xscale(x,c(1319,20578),xrange=c(1,10)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.