Re: [R] remap values from one vector to the other

2013-10-31 Thread Jim Lemon
On 10/31/2013 08:23 PM, Alaios wrote: Hi everyone, I am plotting some legend and I am using the axis(at=..) to specify the place to plot the marks I want. My plotted data have ncol(x) so the at places have values that span from 1 to ncol(x) there I would like to be able to map values that go

Re: [R] remap values from one vector to the other

2013-10-31 Thread Gerrit Eichner
Alex, it is a bit unclear what you mean by "remap" etc., but maybe y0 <- 880e6; y1 <- 1020e6 x0 <- 1; x1 <- ncol(x) y0 + (x0-1):x1 * (y1 - y0)/(x1 - (x0-1)) gives what you want. Hth -- Gerrit On Thu, 31 Oct 2013, Alaios wrote: Hi everyone, I am plotting some legend and I am usi

[R] remap values from one vector to the other

2013-10-31 Thread Alaios
Hi everyone, I am plotting some legend and I am using the axis(at=..) to specify the place to plot the marks I want. My plotted data have ncol(x) so the at places have values that span from 1 to ncol(x) there I would like to be able to map values that go from 880e6 to 1020e6. so 880e6 rem