From p.dalgaard at biostat.ku.dk  Fri Oct 20 01:22:24 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 20 Oct 2006 01:22:24 +0200
Subject: [Rd] bug in rect (PR#9307)
In-Reply-To: <45380390.5010209@stats.uwo.ca>
References: <20061019213434.A40F324796@slim.kubism.ku.dk>
	<45380390.5010209@stats.uwo.ca>
Message-ID: <x2y7rbki1b.fsf@turmalin.kubism.ku.dk>

Duncan Murdoch <murdoch at stats.uwo.ca> writes:

> On 10/19/2006 5:34 PM, jgvcqa at rit.edu wrote:
> > Full_Name: Joe Voelkel
> > Version: 2.4.0
> > OS: Windows XP
> > Submission from: (NULL) (129.21.11.37)
> > 
> > 
> > Using "border=NA" in the call to rect generates an error. But the help file says
> > border=NA is acceptable. 
> > 
> > (The problem is that border=NA evaluates to TRUE for "is.logical(border)" inside
> > the function. Using rect with border=FALSE works fine)
> 
> I don't see this.  Could you post some code to illustrate?

He should, but it is actually plain to see in the code:

    if (!is.null(density) && !is.null(angle)) {
        if (is.logical(border)) {
            if (border)
                border <- col
            else border <- NA
        }

so it requires non-default density and angle to bite. The code should
probably read 

...
   if(!is.na(border) && is.logical(border)) 
... 

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




[Rd] bug in rect (PR#9307)
Peter Dalgaard