[R] combine vectors in an alternating way
Dimitris Rizopoulos
d.rizopoulos at erasmusmc.nl
Wed Oct 20 14:17:17 CEST 2010
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 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
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/
More information about the R-help
mailing list