title: Collocation and compound before a dfm
body: <p>I would like to find phrases using the column of text to take the so I try the collocation option:</p>
  <pre><code>library(quanteda)
  
  dataset1 &lt;- data.frame( anumber = c(1,2,3), text = c(&quot;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.&quot;,&quot;It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum&quot;, &quot;Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.&quot;))
  
      cols &lt;- textstat_collocations(dataset1 $text, size = 2:3, min_count = 30)
  </code></pre>
  <p>After that use compound for their frq try this:</p>
  <pre><code>inputforDfm &lt;- tokens_compound(cols)
  </code></pre>
  <blockquote>
  <p>Error in tokens_compound.default(cols) :
  tokens_compound() only works on tokens objects.</p>
  </blockquote>
  <p>but it needs tokens? How is it possible to make it and insert in the dfm :</p>
  <pre><code>myDfm &lt;- dataset1 %&gt;%
  corpus() %&gt;%
  tokens(remove_punct = TRUE, remove_numbers = TRUE, remove_symbols = TRUE) %&gt;%
  dfm()
  </code></pre>