[R] Simple... but...

Berwin A Turlach berwin at maths.uwa.edu.au
Wed Jul 23 15:44:50 CEST 2008


G'day Shubha,

On Wed, 23 Jul 2008 18:24:49 +0530
"Shubha Vishwanath Karanth" <shubhak at ambaresearch.com> wrote:

> 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....

R> as.vector(rbind(x,y))
[1] 1 2 3 4 5 6

Not sure whether this is the best way, that will depend on what you
defined as "best", i.e.  your loss function. :)

HTH.

Cheers,

	Berwin



More information about the R-help mailing list