title: How to aggregate data in R with mode (most common) value for each row?
body: <p>I have a data set for example,</p>
  
  <pre><code>Data &lt;- data.frame(
    groupname = as.factor(sample(c("a", "b", "c"), 10, replace = TRUE)),
    someuser = sample(c("x", "y", "z"), 10, replace = TRUE))
  
  
     groupname someuser
  1          a        x
  2          b        y
  3          a        x
  4          a        y
  5          c        z
  6          b        x
  7          b        x
  8          c        x
  9          c        y
  10         c        x
  </code></pre>
  
  <p>How do I aggregate the data so that I get:</p>
  
  <pre><code>groupname someuser
  a         x
  b         x
  c         x
  </code></pre>
  
  <p>that is the most common value for each of the groupname.</p>
  
  <p>PS: Given my setup, I have the limitation of using only 2 pakcages - plyr &amp; lubridate</p>