From Martin Maechler <maechler@stat.math.ethz.ch>  Tue Feb 27 14:52:35 2001
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Tue, 27 Feb 2001 15:52:35 +0100
Subject: [Rd] Patch to coplot.R
In-Reply-To: <200102270956.f1R9uGo26080@mafu.ws.chemie.tu-muenchen.de>
References: <200102270956.f1R9uGo26080@mafu.ws.chemie.tu-muenchen.de>
Message-ID: <15003.48947.624227.304611@gargle.gargle.HOWL>

>>>>> "Thomas" == Thomas Baumann <thomas.baumann@ch.tum.de> writes:

      ...

    Thomas> Please find attached a diff for coplot which you may want to
    Thomas> consider for the next release. 

Thank you, Thomas!

    Thomas> The diff is against R 1.2.2. 

unfortunately *not* :

-------- sorry for the excursion --- but I must say this loudly ---
	 {it's by far not the first time, and it's a real pain for us
 	 merging the code!}

  Please -- everyone -- do not consider the output

      > functionname

  (or ESS/Emacs C-c C-d)
  as the source of function  functionname.

  There is only one source, and that is in 
	R-<version>/src/library/<pkg>/R/<foobar>.R
  in our case in
	    R-1.2.2/src/library/base/R/coplot.R

  Again: 
    Please, please do NOT ever patch against the output of typing the
    function name, but please diff against the real source...


---------- end of excursion --------------------

    Thomas> Thanks for looking at the code.

I've been doing that for a bit, now ..


    Thomas> The reasons for this patch are:

    Thomas> 1. The boxes of coplot did not align very well with the panel
    Thomas> graphs if applied to a factor

hmm, well, that's also a matter of taste, but I tend to agree with your
choice (though it slightly complicates the code).

    Thomas> 2. Putting the levels as axis labels instead of just numbers
    Thomas> makes the plot more readable

yes, unless the levels happen to be 10-letter words -- which seems to
happen for some data / people. 
I think one should make this an option (on by default), and also consider using
abbreviate(levels(x), ...) 

    Thomas> I also include a sample dataset (test.asc) and a sample program
    Thomas> to show the differences.

thanks, these *were* useful.

Note however, that you changed more.
We had explicitly 
   - empty boxes when conditioning on  ordinal variables (aka factors)
   - gray boxes  when using "shingles", i.e. conditioning on continuous vars.

you have all boxes gray which I don't necessarily prefer.
(and you should say that you were changing this, too...).
One could consider using two different kinds of gray for the two,
very light gray for factors, darker one for `shingle bars'.

I'm a bit reluctant to change this; R has been a `ripe' piece of software
for a while and people don't necessarily want to see changes that they
can't easily revert.  Hence, the two bg colors (bar backgrounds) would
become function arguments as well....

opinions?

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Patch to coplot.R
Martin Maechler