title: R - remove word from a sentence
body: <p>I have a vector in R which has a list of words at the last index of vector. I need to remove some words out of that list</p>
  
  <pre><code>sentence &lt;- "This is a sample sentence with words like or to be removed"
  wordsToRemove &lt;- c("The","an", "very", "of", "or","in","a","uses","that","be")
  
  splitSent &lt;- strsplit(sentence, " ")
  </code></pre>
  
  <p>I tried <code>wordsToRemove %in% list(splitSent)</code> but that gives all false. Is there any other way to handle it?</p>
  
  <p>Note: the sentence is an element in my vector which has int, other data types as well. And I have gone through below link
  <a href="https://stackoverflow.com/questions/28254164/r-find-vector-in-list-of-vectors">R: find vector in list of vectors</a></p>