I'm trying to create a formula object to pass on to a function that
applies the function terms.formula() to it.
f <- function(formula, ...)
{
...
mf <- match.call()
term <- terms.formula(mf$formula)
...
}
However, my code below gives an error.
form <- as.formula("y~x")
f(form, ...)
The error message was:
Error in terms.formula(mf$formula): argument is not a valid model.
Could anybody help me figure out the problem and find a solution here?
______________________________________________
R-help@r-project.org 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.