Skip to content
Back to formatted view

Raw Message

Message-ID: <x27jo8ulke.fsf@biostat.ku.dk>
Date: 2004-11-27T01:28:49Z
From: Peter Dalgaard
Subject: unexpected behaviour of 'curve' function
In-Reply-To: <sqhfq0tv8iq4viv8ldmhhqspa085u516r5@4ax.com>

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

> Oops, not a bug, behaving as documented (but maybe a design flaw)?
> delay() is documented as defaulting to the global environment.
> curve() should have used "env=environment()".

Or not used delay() at all. That code looks a bit warped.

AFAICT, you could have 'from' defaulting to lims[1] and 'to' to
lims[2], then in the body let 

    if(missing(from) || missing(to))
        lims <- if(missing(xlim)) 
            if (par("xlog")) 
                10 ^ par("usr")[1:2] 
            else 
                 par("usr")[1:2] 
        else
            xlim

and get the same result (notwithstanding that you probably don't want
to use par("usr") in that way)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907