From p.dalgaard@biostat.ku.dk  Tue May  1 20:24:23 2001
From: p.dalgaard@biostat.ku.dk (p.dalgaard@biostat.ku.dk)
Date: Tue, 1 May 2001 21:24:23 +0200 (MET DST)
Subject: [Rd] Re: [R] Crazy plots of time-series against dates (PR#930)
Message-ID: <200105011924.VAA02145@pubhealth.ku.dk>

"Marco Taboga" <mtaboga@tiscalinet.it> writes:

> OK, it works.  xlab and ylab had to be set properly.
> If you want to see what actually goes on, try:
> a<-chron(1:2000)
> b<-1:2000
> plot(a,b,type="l")
> 

One of the standard blunders with R's lazy evaluation and substitute is
to change the value of part of a substitute expression before it is
evaluated. I think the chron maintainer even inserted a note in the
FAQ about that (Hi, Kurt ;) )

In plot.times insert the line below to fix it

    if (!is.null(type <- dots$type)) 
        if (any(type == c("l", "b", "o"))) {
            xlab ; ylab  # force promises
            nas <- is.na(x)
            ...

Cc'ed to R-bugs so that it gets filed and eventually fixed.

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

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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] Re: [R] Crazy plots of time-series against dates (PR#930)
p.dalgaard@biostat.ku.dk