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

> Thanks for your answer, but it doesn't work...
>
> Here is what I get:
> > ssfamean <- aggregate(ssfa[[10:24]],ssfa[c("SPECSHOR", "BONE", "TO_POS",
> "FACETTE", "SHEARFAC", "ENA_BA")],mean)
> Error in .subset2(x, i, exact = exact) :
>   recursive indexing failed at level 2
>

Wouldn't you be better off with rowMeans() ? Split your dataframe into
numeric matrix:

ssfa_num  <- ssfa[10:24]

ssfameans <- rowMeans(ssfa_num)


> Also col_index <- match("Asfc", ssfa) doesn't really work since col_index
> is composed of 1227 NAs...
>
>
>
>

Yes, it should be:

col_index <- match("Asfc", names(ssfa))

Ben

	[[alternative HTML version deleted]]

