On Mon, Jan 18, 2010 at 10:17 AM, Ivan Calandra <
[email protected]> 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]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.