Doran, Harold <HDoran <at> air.org> writes: > > Shubba > > I'm confused. Your first post said the result should be c(1,2,3,4,5,6) > when x and y are combined. The code I sent does that. But here you say > your result should be c(4,1,2,5,2,3). > > What do you want your result to actually be? >
I think he wants x = c(4,2,5) y = c(1,5,3) c(rbind(x,y)) [1] 4 1 2 5 5 3 Or less cryptically/magically: n <- length(x) z <- numeric(2*n) z[seq(1,2*n,by=2)] <- x z[seq(2,2*n,by=2)] <- y Ben Bolker ______________________________________________ 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.