title: Replace a list of words occuring in sentences in R
body: <p>I have a dataframe with list of sentences in one column. Now i have a list of words and another list of replacement words as follows.</p>
  
  <pre><code>DF
  
  Date       Sentences
  9-Nov-16   nah, i got rid of them overyears ago i was only watching pbs by then anyway i have xfinity on demand+netflix on my 'puter
  9-Nov-16   Omg Netflix is working on my Xfinity!
  </code></pre>
  
  <p>and so on</p>
  
  <p><strong>List of Words</strong></p>
  
  <pre><code>words &lt;- c("nah","'puter","Omg")
  trans &lt;- c("No","computer","Oh my God")
  </code></pre>
  
  <p>and so on.</p>
  
  <p>Now i want to replace "Nah" with "No" , "'puter" with "computer", "Omg" with "Oh my God" and so on in the sentences present in the above dataframe. To achieve this i use the following code.</p>
  
  <pre><code>DF$Sentences&lt;- str_replace_all( DF$Sentences, paste0("\\b",words,"\\b"), trans)
  </code></pre>
  
  <p>But this is not replacing the words in the sentence. Can someone tell me the correct way of doing this?</p>