Re: [R] Scaling X axis from -1 to 1

2008-09-15 Thread Jim Lemon
Gundala Viswanath wrote: Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? Hi Gundala, If your data is named "mydata": mynewdata<-rescale(mydata,c(-1,1)) This will linearly transform "mydata" into t

Re: [R] Scaling X axis from -1 to 1

2008-09-14 Thread Yihui Xie
2 * (x - min(x))/(max(x) - min(x)) - 1 On Sun, Sep 14, 2008 at 10:13 PM, Gundala Viswanath <[EMAIL PROTECTED]> wrote: > Hi, > > I have a density plot in which the x axis > ranged from 0 to 2000. > > How can I scale the data so that the x-axis > is scaled in -1 to 1 form? > > - Gundala Viswanath >

[R] Scaling X axis from -1 to 1

2008-09-14 Thread Gundala Viswanath
Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi