[R] sweep by levels of a factor

2010-11-18 Thread Lancaster, Anthony
Hi, I'd appreciate help with this. I have a data matrix with one column, called f in the example below, a factor. I'd like to subtract the means from each of other columns for each level of the factor. That is, in the example, to go from the first matrix below to the second. I know SWEEP will

Re: [R] sweep by levels of a factor

2010-11-18 Thread Lancaster, Anthony
Thank you very much, Tony L. On 18 November 2010 14:02, Lancaster, Anthony anthony_lancas...@brown.eduwrote: Hi, I'd appreciate help with this. I have a data matrix with one column, called f in the example below, a factor. I'd like to subtract the means from each of other columns

Re: [R] sweep by levels of a factor

2010-11-19 Thread Lancaster, Anthony
. On Thu, Nov 18, 2010 at 12:02 PM, Lancaster, Anthony anthony_lancas...@brown.edu wrote: Hi, I'd appreciate help with this. I have a data matrix with one column, called f in the example below, a factor. I'd like to subtract the means from each of other columns for each level of the factor