Re: [R] x-axis order

2007-09-17 Thread jim holtman
But not necessarily performance. Look at the code for 'seq' and 'seq_along'. Time difference may be small, but keystrokes are done only once. On 9/17/07, Patrick Connolly <[EMAIL PROTECTED]> wrote: > On Fri, 14-Sep-2007 at 02:18PM -0400, jim holtman wrote: > > |> This should do what you want. >

Re: [R] x-axis order

2007-09-17 Thread Patrick Connolly
On Fri, 14-Sep-2007 at 02:18PM -0400, jim holtman wrote: |> This should do what you want. |> |> x<-c(26:52,1:25) |> y<-rnorm(52)+1:52 |> |> plot(seq_along(x), y, xaxt='n') |> axis(1, at=seq_along(x), labels=x) And if you have to economize on keystrokes, seq(x) will achieve the same as seq_alon

Re: [R] x-axis order

2007-09-14 Thread jim holtman
This should do what you want. x<-c(26:52,1:25) y<-rnorm(52)+1:52 plot(seq_along(x), y, xaxt='n') axis(1, at=seq_along(x), labels=x) On 9/14/07, Gustaf Rydevik <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a time series which contain data collected weekly from week 26 > to week 25 the followi

[R] x-axis order

2007-09-14 Thread Gustaf Rydevik
Hi all, I have a time series which contain data collected weekly from week 26 to week 25 the following year. How do I plot this data, so that the x-axis is displaying the week numbers, ordered as in the data? Thanks in advance, Gustaf --- x<-c(26:52,1:25) y<-rnorm(52)+1:52 plot(x,y) ## How do