title: Extract words from text using dplyr and stringr
body: <p>I'm trying to find an effective way to extract words from an text column in a dataset. The approach I'm using is</p>
  
  <pre><code>library(dplyr)
  library(stringr)
  
  Text = c("A little bird told me about the dog", "A pig in a poke", "As busy as a bee")
  data = as.data.frame(Text)
  keywords &lt;- paste0(c("bird", "dog", "pig","wolf","cat", "bee", "turtle"), collapse = "|")
  data %&gt;% mutate(Word = str_extract(Text, keywords))
  </code></pre>
  
  <p>It's just an example but I have more than 2000 possible words to extract from each row. I don't know yet another approach to use, but the fact I will have a big regex will make things slow or doesn't matter the size of the regex? I think it will not appear more than one of these words in each row, but there is a way to make multiple columns automatically if more than one word appear in each row?</p>