Skip to content

question about aggregate

11 messages · Weidong Gu, R. Michael Weylandt, Adel ESSAFI

#
try this

table(sci[,2]=0,sci[,1]=L)

Weidong Gu
On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI <adel.safi at imag.fr> wrote:
#
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 <adelessafi at gmail.com> wrote:
#
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 <adelessafi at gmail.com> wrote:
#
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 <adel.safi at imag.fr> wrote: