[R] Bug in coplot()

John Maindonald john.maindonald at anu.edu.au
Fri Jan 15 11:41:05 CET 1999


I am using R0.63.1 under Windows 95.

Settings of <number> and <interval> when coplot is called
are ignored, except for generating a warning.  For example:

> data(quakes)
> coplot(long ~ lat | depth * mag, data = quakes, number=3) 
Warning: parameter "number" couldn't be set in high-level plot() function

The warning is repeated ad nauseum.

The following changes seem needed:
(1) Make <number=6> and <overlap=0.5> named arguments
    to coplot.  (If used as ... parameters, there is an
    attempt to use them as plot parameters, generating the
    warning messages.)

(2) Within the braces following 
    <if(have.b)>
    include the statements

      if(length(number)==1) number<-rep(number,2)      # Add 
      if(length(overlap)==1) overlap<-rep(overlap,2)   # Add 

(3) Change the first invocation of <co.intervals> in <coplot>
    from <else a.intervals <- co.intervals(a)> to

    else a.intervals <- co.intervals(a,number=number[1],overlap=overlap[1]) # Replacement

    and the second invocation from
    from <b.intervals <- co.intervals(b)> to

    else b.intervals <- co.intervals(b,number=number[2],overlap=overlap[2]) # Replacement

(4) One might also check that <number> and <overlap> have
    legal values.

-----------------
Or is there some better way of attending to this?

John Maindonald               email : john.maindonald at anu.edu.au        
Statistical Consulting Unit,  phone : (6249)3998        
c/o CMA, SMS,                 fax   : (6249)5549  
John Dedman Mathematical Sciences Building
Australian National University
Canberra ACT 0200
Australia
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list