'R: Converting names in a column to translated names based on a reference file

Thank you for looking at my question, and happy new year!

My problem/question: I have a dataframe column containing a list of names like this (some also repeating):

Name (German)
Josef
Georg
Mathilde
Josef
Ludwig
Lorenz
Georg
... 

And I want to e.g. convert these names to their English counterpart, with the corresponding names in German and English being contained in another reference file/dataframe like this:

Name (German)    Name (English)
Mathilde         Mathilda
Georg            George
Lorenz           Lawrence
Josef            Joseph
Ludwig           Lewis
...  

So that at the end, my dataframe with a new column would look like this:

Name (German)    Name (English)
Josef            Joseph
Georg            George
Mathilde         Mathilda
Josef            Joseph
Ludwig           Lewis
Lorenz           Lawrence
Georg            George
... 

If anyone knows how to accomplish this, I would be very grateful if you could help me figure out how to do it. In any case, thank you for any help!

With best regards!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source