Complete R noob here so I would appreciate any help that I can get. I currently have a dataframe that looks something like this:
NUMBER RESULT
0 1 2
1 2 4
2 3 6
3 4 8
4 5 10
5 6 12
I have another excel file that functions like a codebook, correspond each specific "NUMBER" to a Name. It looks something like this:
NUMBER NAME
0 1 PETER
1 2 SIMON
2 3 STEPHEN
3 4 DOUGLAS
4 5 ADRIAN
5 6 THOMAS
I have about 1000 numbers with 1000 corresponding names. Is there a way I could set 1 = PETER, 2 = SIMON ... etc, so I would be able to match each "NUMBER" with the corresponding "NAME" create a dataframe that looks like this?
NUMBER RESULTS NAME
0 1 2 PETER
1 2 4 SIMON
2 3 6 STEPHEN
3 4 8 DOUGLAS
4 5 10 ADRIAN
5 6 12 THOMAS
I have tried using the match function, but have not been successful in my pursuit. Any help would be really appreciated! Thank you!