title: Calculate the percentage from a melt dataframe
body: <p>This is the melt dataframe which has the groups</p>
  <pre><code>data.frame(group = c(1,1,2,2), trend = c(&quot;twitter&quot;, &quot;twitter&quot;, &quot;amazon&quot;, &quot;twitter&quot;)
  </code></pre>
  <p>How is it possible to create a new data frame based on the trend per group</p>
  <pre><code>data.frame(group = c(1,1,2,2), trend = c(&quot;Twitter&quot;, &quot;Amazon&quot;, &quot;Twitter&quot;, &quot;Amazon&quot;) value = c(&quot;100%&quot;, &quot;0%&quot;, &quot;50%&quot;, &quot;50%&quot;))
  </code></pre>