suppose I have two data set:
data_set_1:
obs Var_1 Var_2 Var_3
1 002 003 001
2 1.02 0.09 0.23
3 0.02 0.56 1.08
data_set_2:
obs ID Name
1 001 Math
2 002 Phys
3 003 Chem
Now I want to create Data_Set_3 using following criteria:
Compare the first obs of data_set_1 with ID variables of data_set_2. If the result is same, the variable name of data_set_1 will change to the name of Name variables in data_set_2.
I hope I explained my question clearly. And the expected data_set_3 will be like:
data_set_3:
obs Phys Chem Math
1 002 003 001
2 1.02 0.09 0.23
3 0.02 0.56 1.08
Is there a easy way to do this? Thanks.