In a sense, the syntax is easy. Both left and right hand sides must be valid R
expressions.
What you are probably looking for is a complete description of the semantics.
That's quite a different issue. The meaning of terms in a formula, and even
the allowable forms, vary from function to function. For example even lm( ) and
aov( ) allow different forms, the latter using the Error( ) function but the
former not.
Comparing, for example, non-linear and linear regression, the "+"
operator means genuine addition for nls(), but for lm( ), glm( ) and aov( ) it
does not: it means the inclusion of additional terms in the model.
This is a large, and possibly expanding issue. You really need to understand
what formulae are used to specify, and how they do it, for each function you
wish to use. It's not so bad...
W.
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On
Behalf Of Peng Yu [pengyu.ut at gmail.com]
Sent: 15 September 2009 12:01
To: r-help at stat.math.ethz.ch
Subject: [R] syntax of formula
Hi,
I am looking for a complete description of the syntax of the formula
that shall be specified in, for example, aov. But I can't find a
complete description. Can somebody point to me if there is such a
resource?
Regards,
Peng
______________________________________________
R-help at 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.