I have two data sets. Each of them has variables ID, Block, and RT (reaction time). I want to merge/column bind the two sets so that I have one data set with variables: ID, Block, RT1, RT2. The problem is there is unequal number of rows in the two sets. Also, it is important that the ID and block number match. Missing values should be replaced with NA. So what I have:
head(blok1, 10)
ID Blok RT1
1 1 1 592
2 1 1 468
3 1 1 530
4 1 1 546
5 1 1 452
6 1 1 483
7 1 2 499
8 1 2 452
9 1 2 608
10 1 2 530
head(blok2, 10)
ID Blok RT2
1 1 1 592
2 1 1 920
3 1 1 686
4 1 1 561
5 1 1 561
6 1 2 327
7 1 2 686
8 1 2 670
9 1 2 702
10 1 3 920
What I want to have:
ID Blok RT1 RT2
1 1 1 592 592
2 1 1 468 920
3 1 1 530 686
4 1 1 546 561
5 1 1 452 561
6 1 1 483 NA
7 1 2 499 327
8 1 2 452 686
9 1 2 608 670
10 1 2 530 702
etc.