I am working on a project in R. I created a data frame for the table of all projects implemented by an Institutions. The data frame table includes a Country column with a name of the country in which the project is implemented
looks something like this with more than 20,000 rows
$ ProjectID <chr> "P163945", "P169561", "P171613", "P172627"…
$ Region <chr> "Africa West", "Africa East", "Africa West…
$ Country <chr> "Western Africa", "United Republic of Tanz…
$ PName <chr> "Investments towards Resilient Management …
I have also a second table which I scraped and it has country names as well but in shorter format
$ Rank <int> 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, …
$ `Country/region` <chr> "Kenya", "Libya", "Dominica", "Ethiopia", "B…
$ `Real GDP growthrate (%)[1]` <chr> "1.9", "-66.7", "-8.8", "1.9", "3.8", "4.5",…
Now, I would like to rename the country names in the table 1 so they look identicaly like country names in table 2 (so ie. United Republic of Tanzania in table 1 becomes Tanzania from the column 2). I tried to use countrycode package but does not look like it can be helpful in my case. I would like to avoid manually renaming of more than 100 names. Once the names are the same in both columns I would like to use the SQL package in R to set the primary and foreign keys and join the data from the tables together. I will appreciate any advice!