[R] R 2.9.0 plot still forcing current time zone

Britton Stephens stephens at ucar.edu
Wed Jul 8 08:21:18 CEST 2009


the help page for plot.POSIXct says

"As from R 2.9.0 the date-times for a '"POSIXct"' input are
     interpreted in the timwzonw give by the '"tzone"' attribute it
     there is one, otherwise the current timezone.  (Earlier vrsions
     always used the current timezone.)"

however I am using 2.9.0 on linux and the following still happily 
produces an x-axis in local (MDT) time

 > x=strptime(paste('09-01-01 00:00:00',sep=''),format='%y-%m-%d 
%H:%M:%S',tz="GMT")+60*60*24*(seq(0.5,1.5,.1))
 > x
 [1] "2009-01-01 12:00:00 GMT" "2009-01-01 14:24:00 GMT"
 [3] "2009-01-01 16:48:00 GMT" "2009-01-01 19:12:00 GMT"
 [5] "2009-01-01 21:36:00 GMT" "2009-01-02 00:00:00 GMT"
 [7] "2009-01-02 02:24:00 GMT" "2009-01-02 04:48:00 GMT"
 [9] "2009-01-02 07:12:00 GMT" "2009-01-02 09:36:00 GMT"
[11] "2009-01-02 12:00:00 GMT"
 > attributes(x)
$class
[1] "POSIXt"  "POSIXct"

$tzone
[1] "GMT"

 > plot(x,rep(1,11))

Is this a bug, or am I missing something?  Thanks a lot!
Britt

-- 
Britton B. Stephens
National Center for Atmospheric Research
P.O. Box 3000, 1850 Table Mesa Drive
Boulder, CO  80307-3000
Phone: (303) 497-1018
Fax: (303) 497-1092




More information about the R-help mailing list