Re: [R] Help in Programming using Methods

2008-11-23 Thread Gabor Grothendieck
Its a matter of where aov is looking for objects. Try replacing the av<- line in test.data.frame with the following which substitutes in the formula and then evaluates the statement (so that it does not have to look for it): av <- eval(substitute(aov(fo, x), list(fo = formula(model On Sun,

[R] Help in Programming using Methods

2008-11-23 Thread Enio Jelihovschi
I WROTE THIS FUNCTION BELOW test <- function(x, ...) UseMethod('test', x) test.data.frame = function(x, model, which, error, ...) { av <- aov(formula(model), data = x) res <- test.aovlist(av, which = which, error = error) return(res) } test.aovlist <- function(x, which, error, ...) { mm