Re: [R] using tapply on a data frame in a function

2008-09-28 Thread Dieter Menne
eric lee gmail.com> writes: > > Hello, > > I'm trying to use tapply to find group means in a function. It works > outside of a function, but I get the error message from the following code: > "Error in tapply(index, cluster, mean) : arguments must have same length." > Any suggestions? Thanks.

Re: [R] using tapply on a data frame in a function

2008-09-28 Thread Peter Dalgaard
eric lee wrote: Hello, I'm trying to use tapply to find group means in a function. It works outside of a function, but I get the error message from the following code: "Error in tapply(index, cluster, mean) : arguments must have same length." Any suggestions? Thanks. This is neither caused

[R] using tapply on a data frame in a function

2008-09-28 Thread eric lee
Hello, I'm trying to use tapply to find group means in a function. It works outside of a function, but I get the error message from the following code: "Error in tapply(index, cluster, mean) : arguments must have same length." Any suggestions? Thanks. eric d <- data.frame(cbind(cluster=1:2, va