Re: [R] loop in a data.table

2013-03-13 Thread arun
tdat[[z]]<-dat2[,sum(get(ColNames[z]))/sum(e),by="a"]  } do.call(rbind,outputdat) #   a    V1 #1: 1  7.00 #2: 2  7.125000 #3: 1  9.090909 #4: 2 10.125000 #5: 1  9.181818 #6: 2  6.25 A.K. - Original Message - From: Camilo Mora To: r-help@r-project.org Cc:

[R] loop in a data.table

2013-03-13 Thread Camilo Mora
I would like to clarify my previous email about using data.table. imagine the following data.frame called "data": a b c d e 1 12 15 65 6 1 65 85 36 5 2 69 84 35 8 2 45 78 65 8 I want to aggregate the rows of colu

Re: [R] loop in a data.table

2013-03-13 Thread Steve Lianoglou
Hi, On Wed, Mar 13, 2013 at 7:25 PM, Camilo Mora wrote: > Hi everyone, > > I have a data.table called "data" with many columns which I want to group by > column1 using data.table, given how fast it is. > > The problem with looping a data.table is that data.table does not like > quotations to def

[R] loop in a data.table

2013-03-13 Thread Camilo Mora
Hi everyone, I have a data.table called "data" with many columns which I want to group by column1 using data.table, given how fast it is. The problem with looping a data.table is that data.table does not like quotations to define the column names (e.g. "col2" instead of col2). I found a