[R] How to count rows with a condition
smartpink111 at yahoo.com
Wed Oct 17 23:43:53 CEST 2012
I tried the code with unsorted ac_names column and found to be
working. So, couldn't identify exactly the problem. If you can provide
a subset of your dataset using ?dput(), then it would be much helpful.
dat3<-dat2[dat2[,1]%in%count(dat2[,1])$x[count(dat2[,1])>5],] #data excluded
dat4<-dat2[!dat2[,1]%in%count(dat2[,1])$x[count(dat2[,1])>5],] #data included
----- Original Message -----
From: fxen3k <f.sehardt at gmail.com>
To: r-help at r-project.org
Sent: Wednesday, October 17, 2012 9:57 AM
Subject: Re: [R] How to count rows with a condition
Thanks for the first reply.
Unfortunately, my list of different ac_names ist pretty long (about 1,000
different names). Is there a way, to sort them, count the quantity of each
name and exclude these rows, who exceed a particular limit?
View this message in context: http://r.789695.n4.nabble.com/How-to-count-rows-with-a-condition-tp4646454p4646465.html
Sent from the R help mailing list archive at Nabble.com.
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help