[R] combine vectors in an alternating way

2010-10-20 Thread fugelpitch
I have two vectors min 0.2, 0.3, 0.6, 0.1 max 0.4,0.5,0.7,0.4 Is there a way to combine these two vector so that the values will be taken from the vectors alternating so that I will get a new minmaxminmaxminmax-vector? minmax 0.2,0.4,0.3,0.5,0.6,0.7,0.1,0.4 Any help is much appreciated --

Re: [R] combine vectors in an alternating way

2010-10-20 Thread Dimitris Rizopoulos
one way is the following: min.x - c(0.2, 0.3, 0.6, 0.1) max.x - c(0.4, 0.5, 0.7, 0.4) c(rbind(min.x, max.x)) I hope it helps. Best, Dimitris On 10/20/2010 2:13 PM, fugelpitch wrote: I have two vectors min 0.2, 0.3, 0.6, 0.1 max 0.4,0.5,0.7,0.4 Is there a way to combine these two

Re: [R] combine vectors in an alternating way

2010-10-20 Thread Henrique Dallazuanna
Try this: c(matrix(c(Min, Max), 2, byrow = T)) On Wed, Oct 20, 2010 at 10:13 AM, fugelpitch jo...@runtimerecords.netwrote: I have two vectors min 0.2, 0.3, 0.6, 0.1 max 0.4,0.5,0.7,0.4 Is there a way to combine these two vector so that the values will be taken from the vectors

Re: [R] combine vectors in an alternating way

2010-10-20 Thread Ben Bolker
fugelpitch jonas at runtimerecords.net writes: I have two vectors min 0.2, 0.3, 0.6, 0.1 max 0.4,0.5,0.7,0.4 Is there a way to combine these two vector so that the values will be taken from the vectors alternating so that I will get a new minmaxminmaxminmax-vector? minmax