Re: [R] count data with some conditions

2008-11-01 Thread David Winsemius
On Nov 1, 2008, at 3:30 AM, (Ted Harding) wrote: On 01-Nov-08 02:51:37, David Winsemius wrote: Do you want the count of remaining elements which are strictly greater than the first element? length(which(a[1] < a[2:10])) [1] 4 or perhaps a bit more deviously: sum( a[1] [1] 4 No need to

Re: [R] count data with some conditions

2008-11-01 Thread sandsky
David, Yes, it is what I want. It is a great help. Thank you, Jin David Winsemius wrote: > > Do you want the count of remaining elements which are strictly > greater than the first element? > > > length(which(a[1] < a[2:10])) > [1] 4 > > or perhaps a bit more deviously: > > > sum( a[1

Re: [R] count data with some conditions

2008-11-01 Thread Ted Harding
On 01-Nov-08 02:51:37, David Winsemius wrote: > Do you want the count of remaining elements which are strictly > greater than the first element? > > > length(which(a[1] < a[2:10])) > [1] 4 > > or perhaps a bit more deviously: > > > sum( a[1] [1] 4 No need to be devious! Simply sum(a[1] <

Re: [R] count data with some conditions

2008-10-31 Thread David Winsemius
Do you want the count of remaining elements which are strictly greater than the first element? > length(which(a[1] < a[2:10])) [1] 4 or perhaps a bit more deviously: > sum( a[1] Hi there, I have a data set: a=cbind(5,2,4,7,8,3,4,11,1,20) I want to count # of data, satistfying a[1]http://

[R] count data with some conditions

2008-10-31 Thread sandsky
Hi there, I have a data set: a=cbind(5,2,4,7,8,3,4,11,1,20) I want to count # of data, satistfying a[1]http://www.nabble.com/count-data-with-some-conditions-tp20275722p20275722.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r