I want to find and replace a list of words with another list of words.
Say my data is
1) plz suggst med for flu
2) tgif , m goin to have a blast
3) she is getting anorexic day by day
List of words to be replaced are
1) plz -- please
2) pls -- please
3) sugg -- suggest
4) suggst -- suggest
5) tgif -- thank god its friday
6) lol -- laughed out loud
7) med -- medicine
I would like to have 2 lists, list "A" --a list of words to be found and list "B" --a list of words to be replaced with. So that I can keep adding terms to these lists as and when required. I need a mechanism to search for all the words in list "A" and then replace it with corresponding words in list "B".
What is the best way to achieve this in R. Thanks in advance.