Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 209846

How to combine the columns of two data.tables?

$
0
0

I have two tables of the type data.table. I want to combine the tables into one table. They look like:

DT1:

1  A  B  C
2  A  B  C  
3  A  B  C

DT2:

D  E  F
D  E  F
D  E  F

I want to combine them like:

1  A  B  C  D  E  F
2  A  B  C  D  E  F
3  A  B  C  D  E  F

I don't know how I can do this by merging, because the data tables don't have common column names.

I know this is possible with cbind, but I'm working with a lot of rows, so I prefer a function which is built to work with big data tables.

Could anyone tell me how to do this?


Viewing all articles
Browse latest Browse all 209846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>