Count from long to wide format : <p>Having a long format like this:</p>

<pre><code>df &lt;- data.frame(id = c(1,1,1,2,2), text = c("stock","arrange","stock","arrange","arrange"))
</code></pre>

<p>How is it possible to receive the wide format of making the variables in text column new columns which have as values the number the exist?
Example of expected output:</p>

<pre><code>data.frame(id = c(1,2) stock = c(2,0), arrange = c(1,2))
</code></pre>
