[R] x-axis order
jim holtman
jholtman at gmail.com
Mon Sep 17 21:59:09 CEST 2007
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 <p_connolly at ihug.co.nz> wrote:
> 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_along(x)
>
> HTH
>
> --
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
> ___ Patrick Connolly
> {~._.~} Great minds discuss ideas
> _( Y )_ Middle minds discuss events
> (:_~*~_:) Small minds discuss people
> (_)-(_) ..... Anon
>
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help
mailing list