[R] Passing data to aov

2010-08-26 Thread Bryan Hanson
Hello Again Gurus and Lurkers: I¹m trying to build a very user-friendly function which does aov without having the user type in a formula (which would be tedious in this case). The idea is to take the response from a PCA score matrix, and the factors from a list. A simple example is the function

Re: [R] Passing data to aov

2010-08-26 Thread Ivan Calandra
Hi, First, some toy data would have helped a lot, and that can explain why you got so few answers... Second, I have maybe some thoughts about it, not sure if this can help. The error tells you that the data passed to aov is not a matrix. In your function, you don't specify explicitly the

Re: [R] Passing data to aov

2010-08-26 Thread David Winsemius
On Aug 26, 2010, at 8:47 AM, Bryan Hanson wrote: Hello Again Gurus and Lurkers: I’m trying to build a very user-friendly function which does aov without having the user type in a formula (which would be tedious in this case). The idea is to take the response from a PCA score matrix, and

Re: [R] Passing data to aov

2010-08-26 Thread Ivan Calandra
Hi! I didn't see the toy data, my bad. I guess David's solution fixed the problem. Ivan Le 8/26/2010 16:10, Bryan Hanson a écrit : Hi Ivan, there is toy data given in the original post. The object passed to aov is a matrix, it is called scores, and it is passed via the formula that is

Re: [R] Passing data to aov

2010-08-26 Thread Bryan Hanson
A big thanks David! Eliminating the env = parent.frame() seems to fix everything. I hate it when I'm that close... I included that because from ?as.formula it seemed to be the default, but on re-read, I guess it doesn't really say that. In addition, I had included it even though it was the