mardi 3 mars 2020

How to replace a word by another using if statement and str_replace in r

I use a dataset with string characters that contains some wrong translations. One column shows the words in the original language ("name.french"). In the next column their translations are listed ("name.english"). Now I want to use the following command to replace the wrong translations with the correct ones:

if(name.french == "framboise"){name.english = str_replace(name.english, "rasperry", "rasberry");}

However, I always get the following error message: Argument cannot be interpreted as logical value. Is there another way of replacing some wrong translations?

Aucun commentaire:

Enregistrer un commentaire