[R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
Hi, I am trying to calculate the sum for each occurrence of the level of a factor in a very large matrix. In addition, I want to save that sum together with the information of the level of the factor and the level of a second factor. My matrix looks like this: x<-matrix(c(1,1,1,2,2,3,3,1,1,7,

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread hadley wickham
On Sun, Jul 20, 2008 at 4:16 PM, Ralph S. <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to calculate the sum for each occurrence of the level of a factor > in a very large matrix. In addition, I want to save that sum together with > the information of the level of the factor and the level of

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread hadley wickham
On Sun, Jul 20, 2008 at 4:47 PM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Sun, Jul 20, 2008 at 4:16 PM, Ralph S. <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I am trying to calculate the sum for each occurrence of the level of a >> factor in a very large matrix. In addition, I want to save tha

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
20 Jul 2008 16:50:41 -0700 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: Re: [R] Sum efficiently from large matrix according to re-occuring > levels of factor? > CC: r-help@r-project.org > > On Sun, Jul 20, 2008 at 4:47 PM, hadley wickham wrote: >> O

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread jim holtman
--- >> Date: Sun, 20 Jul 2008 16:50:41 -0700 >> From: [EMAIL PROTECTED] >> To: [EMAIL PROTECTED] >> Subject: Re: [R] Sum efficiently from large matrix according to re-occuring >> levels of factor? >> CC: r-help@r-project.org >&g

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
he sum >> with that corresponding entry, and then record the result of that. >> >> Any idea? >> >> Best, >> >> Ralph >> >> >> >> ---------------- >>> Date: Sun, 20 Jul 2008 16:50:41 -0700 >>> From: [EMAIL PROTECT

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-21 Thread hadley wickham
- >> Date: Sun, 20 Jul 2008 21:21:35 -0400 >> From: [EMAIL PROTECTED] >> To: [EMAIL PROTECTED] >> Subject: Re: [R] Sum efficiently from large matrix according to re-occuring >> levels of factor? >> CC: [EMAIL PROTECTED]; r-help@r-project.org >> >> Does t