Gunadi wrote:
>
> I am sure this is easy but I am not finding a function to do this.
>
> I have two columns in a matrix. The first column contains multiple entries
> of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column
> contains unique numbers. I want to sum the numbers in
Try this:
with(DF, rowsum(Col2, Col1))
On Mon, Nov 16, 2009 at 3:49 PM, Gunadi wrote:
>
> I am sure this is easy but I am not finding a function to do this.
>
> I have two columns in a matrix. The first column contains multiple entries
> of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The
P=data.frame(x=c(1,1,2,3,2,1),y=rnorm(6))
tapply(P$y,P$x,sum)
regards,
stefan
On Mon, Nov 16, 2009 at 09:49:17AM -0800, Gunadi wrote:
>
> I am sure this is easy but I am not finding a function to do this.
>
> I have two columns in a matrix. The first column contains multiple entries
> of n
I am sure this is easy but I am not finding a function to do this.
I have two columns in a matrix. The first column contains multiple entries
of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column
contains unique numbers. I want to sum the numbers in column two based on
the inde
4 matches
Mail list logo