[R] Simple... but...

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be
Wed Jul 23 15:29:47 CEST 2008


check the following:

x <- c(1,3,5)
y <- c(2,4,6)

c(t(cbind(x, y)))
c(matrix(c(x, y), 2, by = TRUE))


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://perswww.kuleuven.be/dimitris_rizopoulos/


----- Original Message ----- 
From: "Shubha Vishwanath Karanth" <shubhak at ambaresearch.com>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, July 23, 2008 2:54 PM
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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



More information about the R-help mailing list