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

From: Gustaf Rydevik <gustaf.rydevik_at_gmail.com>
Date: Wed, 23 Jul 2008 15:58:29 +0200

On Wed, Jul 23, 2008 at 3:23 PM, Doran, Harold <HDoran_at_air.org> wrote:
> 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?
>
>> -----Original Message-----
>> From: Shubha Vishwanath Karanth [mailto:shubhak_at_ambaresearch.com]
>> Sent: Wednesday, July 23, 2008 9:17 AM
>> To: Doran, Harold; r-help_at_stat.math.ethz.ch
>> Subject: RE: [R] Simple... but...
>>
>> OK,
>>
>> Let x=c(4,2,2)
>> y=c(1,5,3)
>>
>> My result should be c(4,1,2,5,2,3)
>>
>> Thanks, Shubha
>>

There should be nicer ways, but this does it:

x<-c(4,2,2)
y<-c(1,5,3)
c(matrix(c(x,y),byrow=T,nrow=2))

/Gustaf

-- 
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik

______________________________________________
R-help_at_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.
Received on Wed 23 Jul 2008 - 15:14:46 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive