Re: [R] Simple... but...

From: Ben Bolker <>
Date: Wed, 23 Jul 2008 14:05:35 +0000 (UTC)

Doran, Harold <HDoran <at>> 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)

[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 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Jul 2008 - 15:21:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 15:32:16 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive