I am not sure if this question has been addressed before, at least in direct form.
I have a paragraph like this:
"While all my efforts to pacify him failed, I still hoped that he would continue to value our friendship. We had been great friends for the past 18 years, and I don't know why a simple difference of opinion should make him so mad! Well, life is strange, and has its ways, I guess"
I want the following replacements in the passage:
"While all my efforts" -> <my-attempt>
"to pacify him" -> <to-make-things-better>
"failed" -> <failure>
"I still hoped" -> <hope>
"we had been great friends" -> <we-were-friends>
"so mad" -> <unhappy>
Rest of the text can remain as is.
Is it possible to do this with a single call to a regular expression function in R ?
Thanks!