He wants a[1] b[1] a[2] b[2] a[3] b[3]
I think you can do:
x =  as.vector(rbind(a, b))



On Mon, Mar 24, 2014 at 2:39 PM, Frans Marcelissen <
fransiepansiekever...@gmail.com> wrote:

> Why not simply
>
> > a<-1:3
> > b<-4:5
> > c(a,b)
> [1] 1 2 3 4 5
>
>
> 2014-03-22 23:22 GMT+01:00 Tham Tran <hanhtham.t...@yahoo.com.vn>:
>
> > Dear R users,
> >
> > Given two vectors x and y
> > a=1 2 3
> > b=4 5 6
> >
> > i want to combine them into a single vector z as 1 4 2 5 3 6
> >
> > Thanks for your help
> >
> > Tham
> >
> >
> >
> > --
> > View this message in context:
> > http://r.789695.n4.nabble.com/Merge-two-vectors-into-one-tp4687361.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to