[R] cbind with headers

Docbanks84 mbanks3 at partners.org
Thu Aug 8 15:15:11 CEST 2013


Hi,

I can't seem to get this to work:
http://www.endmemo.com/program/R/cbind.php

Do I save the data as data1.csv in note pad and pull in the file? Do I type
data1.csv<-Subtype,Gender,Expression,A,m,-0.54,A,f,-0.8,B,f,-1.03,C,m,-0.41??

I can do a simple matrix. But, I want to have headers and data to combine.

Simple Matrix I combined.
> m<-as.data.frame(matrix(c(1:6),ncol=2))
> n<-as.data.frame(matrix(c(7:12),ncol=2))
> m
  V1 V2
1  1  4
2  2  5
3  3  6
> n
  V1 V2
1  7 10
2  8 11
3  9 12
> Mary<-cbind(m,n)
> Mary
  V1 V2 V1 V2
1  1  4  7 10
2  2  5  8 11
3  3  6  9 12




--
View this message in context: http://r.789695.n4.nabble.com/cbind-with-headers-tp4673354.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list