Re: [R] Find interval between numbers in list or vector

2012-02-11 Thread alend
Thanks, it is exactly the function that I needed. -- View this message in context: http://r.789695.n4.nabble.com/Find-interval-between-numbers-in-list-or-vector-tp4376115p4378473.html Sent from the R help mailing list archive at Nabble.com. __

[R] Find interval between numbers in list or vector

2012-02-10 Thread alend
hi, I have a vector as follow: myVec = c(1,4,10,30) How can I get a vector that show the interval of the numbers. I need to get this result: distance 3,6,20 -- View this message in context:

Re: [R] Find interval between numbers in list or vector

2012-02-10 Thread Dimitris Rizopoulos
Have a look at function diff(), e.g., diff(c(1,4,10,30)) I hope it helps. Best, Dimitris On 2/10/2012 1:33 PM, alend wrote: hi, I have a vector as follow: myVec = c(1,4,10,30) How can I get a vector that show the interval of the numbers. I need to get this result: distance