From: Berwin A Turlach <berwin_at_maths.uwa.edu.au>

Date: Tue 29 Mar 2005 - 08:00:23 GMT

In case that a user foolishly specifies a more complicated formula having not read the help pages. It seemed to me that this was the only construct to figure out which variables are actually appearing in terms of the formula.

R-devel@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Mar 29 18:03:56 2005

Date: Tue 29 Mar 2005 - 08:00:23 GMT

>>>>> "BDR" == Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:

BDR> On Tue, 29 Mar 2005, Berwin A Turlach wrote:

>> Dear all,

* >>
** >> I would like to suggest changing the pairs.formula command such
** >> that a command like
** >> [...]
*

BDR> Perhaps you could explain what precisely 'the job' is Sorry, for not making it clear enough, must be that English is my second language. What I meant is, that with the above definition of pairs.formula a command like

pairs(GNP ~ . - Year - GNP.deflator, longley) would only produce a pairwise scatterplot of GNP and all other variables in the dataframe except for Year and GNP.deflator. And, incidentally, so would

pairs( ~ . - Year - GNP.deflator, longley)

BDR> and why you chose such an unusual piece of code to do it? Mmh, I don't think of it as being so unusual, most of it was gleaned from other R function. Well, I realise that R programing paradigms change over the years, so I must have gotten them from quite old routine.

BDR> (E.g. what is the prescription for the ordering of terms, and BDR> why do you think the rownames of the factors and the BDR> variables might be in different orders? They are set the BDR> same in the C code.)

In case that a user foolishly specifies a more complicated formula having not read the help pages. It seemed to me that this was the only construct to figure out which variables are actually appearing in terms of the formula.

BDR> Why do you want to allow a response? Why not, the current version allows it too. At least the help page in my version of R states:

(A response will be interpreted as another variable, but not treated specially, so it is confusing to use one.)

Actually, I noticed that the response variable will always be in the top row, so it is treated specially. Try it out and compare:

> pairs(longley)

> pairs(GNP ~ ., longley)

BDR> Currently only '+' is documented to work. The help page for pairs in my version of R states:

formula: a formula, such as '~ x + y + z'. Each term will give a

separate variable in the pairs plot, so terms should be numeric vectors. (A response will be interpreted as another variable, but not treated specially, so it is confusing to use one.)

Best wishes,

Berwin

- Full address ============================
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics +61 (8) 6488 3383 (self)
The University of Western Australia FAX : +61 (8) 6488 1028
35 Stirling Highway
Crawley WA 6009 e-mail: berwin@maths.uwa.edu.au
Australia http://www.maths.uwa.edu.au/~berwin

R-devel@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Mar 29 18:03:56 2005

*
This archive was generated by hypermail 2.1.8
: Mon 20 Feb 2006 - 03:21:02 GMT
*