Re: [R] multiplying values in data frame by corresponding value in the first column

2010-09-21 Thread Martin Tomko
Thank you Marc, that was an elegant solution, works perfectly! Martin On 9/21/2010 10:24 PM, Marc Schwartz wrote: DF[, -c(1:2)]<- DF[, -c(1:2)] * DF$Group __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] multiplying values in data frame by corresponding value in the first column

2010-09-21 Thread Marc Schwartz
On Sep 21, 2010, at 3:00 PM, Martin Tomko wrote: > I am sure there is a simple solution to this... I have a column in a data > frame specifying a grouping (1, -1) for my observations, and need to mutliply > each observation in all the other columns of the data frame by the > corresponding value

[R] multiplying values in data frame by corresponding value in the first column

2010-09-21 Thread Martin Tomko
I am sure there is a simple solution to this... I have a column in a data frame specifying a grouping (1, -1) for my observations, and need to mutliply each observation in all the other columns of the data frame by the corresponding value in the given column. I played with apply, and saw some s