title: R - ff package : find the most frequent element in ffdf and delete the rows where is located
body: <p>I need a suggestion to find the most frequent element in ffdf and after that to delete the rows where is located.
  I decided to try the ff package as I'm working with very big data and with base R I am running out of memory.</p>
  
  <p>Here is a little example:</p>
  
  <pre><code> # create a base R Matrix
  
   &gt; z&lt;-matrix(c("a", "b", "a", "c", "b", "b", "c", "c", "b", "a"),nrow=5,ncol=2,byrow = TRUE)
   &gt; z
  
  
       [,1] [,2]
   [1,] "a"  "b" 
   [2,] "a"  "c" 
   [3,] "b"  "b" 
   [4,] "c"  "c" 
   [5,] "b"  "a" 
  
  
   # convert z to ffdf
  
   &gt; u=as.data.frame(z, stringsAsFactors=TRUE)
   &gt; u=as.ffdf(u)
   &gt; u
  
    ffdf data
     V1 V2
  1  a  b
  2  a  c
  3  b  b
  4  c  c
  5  b  a
  </code></pre>
  
  <p>Im looking for:</p>
  
  <ul>
  <li>Export the most frequent element in ffdf (in this case it is "b")</li>
  <li>Delete from ffdf all the rows where "b" is located</li>
  </ul>
  
  <p>So, the new ffdf must be as below:</p>
  
  <pre><code>   V1 V2
  1  a  c
  2  c  c
  </code></pre>
  
  <p>In base R I found the way with the "table" function</p>
  
  <pre><code>  temp &lt;- table(as.vector(z))  
    t1&lt;-names(temp)[temp == max(temp)] 
    z1&lt;- z[rowSums(z== t1[1]) == 0, ]    
  </code></pre>
  
  <p>But working with huge data I need something like the ff package.</p>