In R 2.12.0 I get > d <- data.frame(x=1:10, y=log(1:10), f3=LETTERS[rep(1:3,c(3,3,4))]) > m <- model.frame(y~.^2, data=d) > formula(m) y ~ x + f3 In S+ formula(m) gives formula given to model.frame(), but in R you have to do the following get that formula: > formula(attr(m, "terms")) y ~ (x + f3)^2
Would it break anything to add to the top of formula.data.frame something like if (!is.null(tms <- attr(x, "terms"))) { return(formula(tms)) } so that formula() would retrieve the formula buried in model.frame's output? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel