Removing items from a dataset that have too few mentions <p>I am beginning <strong>R</strong> user and I have a question about a problem I encountered: </p> <ul> <li>Very large dataset (almost 800k rows) </li> <li>This dataset lists all contributions to a politicians in the 90s in the US </li> </ul> <p>After some data cleaning, I needed to reduce the list to a more manageable size. Since I am interested in contributors who have donated more than once, I have decided to try to limit the size of the dataset like that.</p> <p>The dataset is loaded as "cont"</p> <p>My intention:</p> <ol> <li><p>Map frequencies of mentions:</p> <pre><code>&gt; table(cont$contributor_name) -&gt; FreqCon &gt; subset(FreqCon,Freq&gt;4) -&gt; FMI </code></pre></li> <li><p>Insert an extra column as cont[,43] with name "include" that would say TRUE or FALSE for whether I should subset it</p> <pre><code>for(i in 1:dim(FMI)[1]){ + ifelse(cont[i,11] %in% FMI[,1],cont[i,43] &lt;- TRUE, cont[i,43] &lt;- FALSE) } </code></pre></li> <li><p>Subset the dataset based on <code>cont$include</code></p></li> </ol> <p>I hope that is all relevant information. I am happy to provide more info if needed! Also:<code>cont[,11] = cont$contributor_name</code></p> <p><em>THE PROBLEM</em>: Currently, <strong>R</strong> is working very hard, but does not seem to change anything in the column. I am confused as to what I am doing wrong, since I am not getting any <code>warnings()</code> or Errors.</p> <p>Maybe I am trying to reinvent the wheel so any way of accomplishing what I set out to do would be much appreciated!</p>