Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Thank you I works as I need. > aggregate(tmp[,5],list(tmp[,2],tmp[,1]),function(x) sum(table(x))) Group.1 Group.2 x 1 0.0 D 100 2 0.2 D 100 3 0.4 D 100 4 0.6 D 72 5 0.8 D 9 2011/10/22 Weidong Gu > Thanks for providing the example data,

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
Thanks for providing the example data, try this aggregate(si[,7],list(si[,2],si[,1]),function(x) sum(table(x))) Weidong On Sat, Oct 22, 2011 at 9:28 AM, Adel ESSAFI wrote: > NO >> aggregate(si[,7],list(si[,2],si[,1]),mean) >    Group.1 Group.2   x > 1  0.0   D 212.5015448 > 2  

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
2011/10/22 Adel ESSAFI > NO > > aggregate(si[,7],list(si[,2],si[,1]),mean) >Group.1 Group.2 x > 1 0.0 D 212.5015448 > 2 0.2 D 200.5271137 > 3 0.4 D 191.5387529 > 4 0.6 D 131.5856218 > 5 0.8 D 16.4515798 > 6 1.0 D 0

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
NO > aggregate(si[,7],list(si[,2],si[,1]),mean) Group.1 Group.2 x 1 0.0 D 212.5015448 2 0.2 D 200.5271137 3 0.4 D 191.5387529 4 0.6 D 131.5856218 5 0.8 D 16.4515798 6 1.0 D 0.9698699 7 0.0 F 211.6176036 8

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
Is this waht you want? sci[,5][sci[,2]==0 & sci[,1]==L] Weidong On Sat, Oct 22, 2011 at 8:19 AM, Adel ESSAFI wrote: > Hi, > It is not what I want, but, thx anyway. > Regards > > > 2011/10/22 Weidong Gu >> >> try this >> >> table(sci[,2]=0,sci[,1]=L) >> >> Weidong Gu >> >> On Sat, Oct 22, 2011

Re: [R] question about aggregate

2011-10-22 Thread R. Michael Weylandt
Perhaps I misunderstand your request, but isn't this just: sum( (sci[,,2]==0L) & (sci[,1] =="L")) with the usual floating point caveats. Michael On Sat, Oct 22, 2011 at 8:19 AM, Adel ESSAFI wrote: > Hi, > It is not what I want, but, thx anyway. > Regards > > > 2011/10/22 Weidong Gu > >> try t

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Hi, It is not what I want, but, thx anyway. Regards 2011/10/22 Weidong Gu > try this > > table(sci[,2]=0,sci[,1]=L) > > Weidong Gu > > On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI wrote: > > Hello, > > is there any help please. > > Regards > > > > > > 2011/10/21 Adel ESSAFI > > > >> Hello > >

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
try this table(sci[,2]=0,sci[,1]=L) Weidong Gu On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI wrote: > Hello, > is there any help please. > Regards > > > 2011/10/21 Adel ESSAFI > >> Hello >> I am discovering R and I find it is really very powerful. >> >> However, I find some newbie difficulties.

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Hello, is there any help please. Regards 2011/10/21 Adel ESSAFI > Hello > I am discovering R and I find it is really very powerful. > > However, I find some newbie difficulties. > > Here, I have a data frame with manu values that I want to calculate the > frequency (the nomber of line) of the s