I have a dataframe named mydata, which includes the information of hundreds county name and their corresponding state name. The dataframe looks like this:
County.code State.code County.name State.name
1. 1 1 Autauga Alabama
2. 2 1 Baldwin Alabama
3. 3 1 Barbour Alabama
4. 1 2 Bethel Alaska
5. 2 2 Dillingham Alaska
6. 1 3 Apache Arizona
7. 2 3 Cochise Arizona
Now I have another dataframe named df, which includes two columns of county code and state code data without order:
County.code State.code
1. 5 3
2. 3 11
3. 9 8
4. 1 5
... ...
My question is how can I replace those number in df with its corresponding county name and state name?