[R] count data with some conditions
dwinsemius at comcast.net
Sat Nov 1 03:51:37 CET 2008
Do you want the count of remaining elements which are strictly
greater than the first element?
> length(which(a < a[2:10]))
or perhaps a bit more deviously:
> sum( a<a[2:10]+0 ) #adding 0 to TRUE or FALSE creates 1 or 0.
David Winsemius, MD
On Oct 31, 2008, at 7:56 PM, sandsky wrote:
> Hi there,
> I have a data set:
> I want to count # of data, satistfying a<a[2:10].
> Anyone helps me solving this case?
> Thank you in advance,
> View this message in context: http://www.nabble.com/count-data-with-some-conditions-tp20275722p20275722.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