[R] Join data frame columns

brunosm brunosm87 at gmail.com
Tue Oct 23 15:13:29 CEST 2012


Hi Ivan, thanks for your help!

For example:

> df
  num letters
1   1       A
2   2       B
3   3       C
4   4       D
5   5       E

What i want is to join "num" and "letters" in a single column. Something
like this

> new_df
1   1       
2   2       
3   3       
4   4       
5   5       
6  A
7  B
8  C
9  D
10  E

I tried to do it with a list but it converts factors to numbers... 

> new_df<-list(c(df[,1],df[,2]))
> new_df
[[1]]
 [1] 1 2 3 4 5 1 2 3 4 5

Thanks!



--
View this message in context: http://r.789695.n4.nabble.com/Join-data-frame-columns-tp4647113p4647132.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list