Re: [R] how to not sort factors when plotting

From: Lydia N. Slobodian <>
Date: Mon, 12 May 2008 14:52:15 +0100

Hello. I'm trying find the ratios between each of the integers in a vector. I have:

for (n in x) {

   ratio <- (x[n]/x[n-1])
   ratio.all <- c(ratio.all, ratio)

Of course this doesn't work, nor does diff(n)/diff(n-1). Is there a way to specify a pair of integers in a vector?

Thank you,

Lydia mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 12 May 2008 - 14:01:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 16:30:37 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive