On Mon, Jan 18, 2010 at 10:33 AM, Ivan Calandra <
ivan.calandra@uni-hamburg.de> wrote:

> I didn't understand from the help what really does the function rowMeans
> but it looks like it doesn't take into account the categorical variables (I
> want to calculate the means when the values of all categorical variables are
> the same, second part of aggregate). Moreover, ssfa_num contains only
> numeric variables, meaning that the categories will not be associated with
> it.
> I'm kind of confused with this approach.
> You think it would work for me?
>

Conditional index to subset the data:

ssfa_num_grp1 <- ssfa[10:24][CatCol == "Condition1"]
ssfa_num_grp2 <- ssfa[10:24][CatCol2 == "Condition2"]

Again to assign back to source dataframe:

ssfa$mean[CatCol == "Condition1"] <- ssfa_num_grp1

It should be fairly straight forward to roll it into a loop thereafter.

Ben

	[[alternative HTML version deleted]]

