[R] datetime data and plotting

Gabor Grothendieck ggrothendieck at myway.com
Sat Oct 18 01:46:06 CEST 2003



Yes.  The timezone is not the whole problem.

What one would really like is that plot understands that it is
being given daily data and acts accordingly, in the same
way that plot already understands that its being given a factor
object or a dendogram, etc. and produces the right plot.

The OO way would be that the data describes itself, "telling" 
plot what it is being given so that plot can make the right choice.

---

Date: Fri, 17 Oct 2003 20:47:17 +0100 (BST) 
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
[ Add to Address Book | Block Address | Report as Spam ] 
To: Don MacQueen <macq at llnl.gov> 
Cc: Jacob Etches <jetches at iwh.on.ca>, <r-help at stat.math.ethz.ch> 
Subject: Re: [R] datetime data and plotting 

 
 
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



_______________________________________________
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com




More information about the R-help mailing list