 <p><strong>Update: I think this solution is less good then the other one I posted above, but I am leaving it as an example of a solution - which is not so good :) *</strong></p> <p>Hi Rishard,</p> <p>It's a bit difficult with out some sample data to help.</p> <p>But it sound like you could reshape your data using "melt" and "cast" from the "reshape" package. Doing that will enable you to find where you have too few observation per subject, and then use that information to subset your data.</p> <p>Here is an example code of how this can be done:</p> <pre><code>xx &lt;- data.frame(subject = rep(1:4, each = 3), observation.per.subject = rep(rep(1:3), 4)) xx.mis &lt;- xx[-c(2,5),] require(reshape) num.of.obs.per.subject &lt;- cast(xx.mis, subject ~.) the.number &lt;- num.of.obs.per.subject[,2] subjects.to.keep &lt;- num.of.obs.per.subject[,1] [the.number == 3] ss.index.of.who.to.keep &lt;- xx.mis $subject %in% subjects.to.keep xx.to.work.with &lt;- xx.mis[ss.index.of.who.to.keep ,] xx.to.work.with </code></pre> <p>Cheers,</p> <p>Tal</p>