[R] suppressing time shift in plot of POSIXct object?

Jim Porzak jporzak at gmail.com
Mon Jan 26 23:47:30 CET 2009


Friends,

I have a POSIXct vector "located" in EST timezone. When I plot against
it here in PST, the time axis is shifted 3 hours back in time. IOW,
plot adjusts for time zone difference. Now that's really great, if
that's what one wants. However, I want time axis to use actual times
in object (without any shift).

For example:

n <- 360
y <- rnorm(n)
t <- seq(from = as.POSIXct("2009-01-26 12:00:00", tz = "EST"), by =
60, length.out = n)
head(t)
#[ 1] "2009-01-26 12:00:00 EST" "2009-01-26 12:01:00 EST" "2009-01-26
12:02:00 EST"
# [4] "2009-01-26 12:03:00 EST" "2009-01-26 12:04:00 EST" "2009-01-26
12:05:00 EST"
Sys.timezone()
# [1] "PST"

#But doing:
plot(y ~ t, type = "l")

results in plot starting at 09:00 (here in California)

I've poked around in help, etc but haven't any way to force use of
timezone in t.

What am I missing?

TIA,
Jim Porzak
TGN.com
San Francisco, CA
http://www.linkedin.com/in/jimporzak
use R! Group SF: http://ia.meetup.com/67/




More information about the R-help mailing list