[R] Simple... but...

Doran, Harold HDoran at air.org
Wed Jul 23 15:36:15 CEST 2008


How about this

as.vector(t(cbind(x,y)))
 

> -----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
>  
> -----Original Message-----
> From: Doran, Harold [mailto:HDoran at air.org]
> Sent: Wednesday, July 23, 2008 6:47 PM
> To: Shubha Vishwanath Karanth; r-help at stat.math.ethz.ch
> Subject: RE: [R] Simple... but...
> 
> x <-  c(1,3,5)
> y <-  c(2,4,6)
> 
> sort(c(x,y))
> 
> > -----Original Message-----
> > From: r-help-bounces at r-project.org
> > [mailto:r-help-bounces at r-project.org] On Behalf Of Shubha 
> Vishwanath 
> > Karanth
> > Sent: Wednesday, July 23, 2008 8:55 AM
> > To: r-help at stat.math.ethz.ch
> > Subject: [R] Simple... but...
> > 
> > Hi R,
> > 
> >  
> > 
> > If
> > 
> > x=c(1,3,5)
> > 
> > y=c(2,4,6)
> > 
> >  
> > 
> > I need a vector which is c(1,2,3,4,5,6) from x and y.
> > 
> >  
> > 
> > How do I do it? I mean the best way....
> > 
> >  
> > 
> > Thanks, Shubha
> > 
> >  
> > 
> > This e-mail may contain confidential and/or privileged 
> > i...{{dropped:13}}
> > 
> > ______________________________________________
> > 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.
> > 
> This e-mail may contain confidential and/or privileged 
> information. If you are not the intended recipient (or have 
> received this e-mail in error) please notify the sender 
> immediately and destroy this e-mail. Any unauthorized 
> copying, disclosure or distribution of the material in this 
> e-mail is strictly forbidden.  Any views or opinions 
> presented are solely those of the author and do not 
> necessarily represent those of Amba Holdings Inc., and/or its 
> affiliates.  Important additional terms relating to this 
> email can be obtained at  http://www.ambaresearch.com/disclaimer
> 
> 



More information about the R-help mailing list