I'm currently working with several datasets in R. One of these datasets has blanks in every row before every country name such as " Afghanistan". If I now want to merge this dataset with another dataset by country name R can't match the names because of the blanks. I now want to remove these blanks before every name but not between the names: e.g. the blank between "The" and "Bahamas" should stay there and only the blanks before the name should disappear in every row. How can I do that?
Thank you very much for your reply