[R] datetime data and plotting

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Oct 17 21:47:17 CEST 2003


So someone forgot to specify the timezone, if the current one was not 
wanted.

However, I don't see how timezones can account for a 24hour difference 
as originally reported.

On Fri, 17 Oct 2003, Don MacQueen wrote:

> I do see the described behavior, on three systems, linux R 1.8.0, Mac 
> OS X R 1.8.0, and Solaris R 1.7.1.
> Plot 1 is different than plot 2; in plot 1 the points are offset to 
> the left of the axis tick marks.
> 
> datet <- as.POSIXct(dates)
> 
> ## 1
> plot(datet,WEIGHT.KG)
> 
> ## 2
> plot(datet,WEIGHT.KG,xaxt='n')
> axis.POSIXct(1,at=datet)
> 
> To investigate a bit, I made a copy of axis.POSIXct and modified it 
> slightly to return the value of "at" that it calculates. I get this:
> "2003-10-06 17:00:00 PDT" "2003-10-08 17:00:00 PDT"
> "2003-10-10 17:00:00 PDT" "2003-10-12 17:00:00 PDT"
> "2003-10-14 17:00:00 PDT"

Have you heard of debug()?

> These are equal to midnight GMT, since my systems are currently in 
> PDT, i.e. GMT-7.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list