Use Sys.setenv(TZ="Etc/GMT+8") before you read the files.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

Bill Harris <bill_harris@facilitatedsystems.com> wrote:

I'm reading in ~3 years worth of data that includes hourly timestamps. Presumably to avoid DST confusion, all the data is in PST time zone -- no discontinuities in the spring or fall. The data comes in a csv file, which I'm reading with myvariable <- read.csv("my_data_file.csv",header=FALSE, col.names=c("timedate","values"),colClasses=c("POSIXct","numeric")) The time zone comes in as PST or PDT, as appropriate. That leads to problems in the spring: > temps$timedate[2185:2190] [1] "2006-04-02 00:00:00 PST" "2006-04-02 01:00:00 PST" [3] NA "2006-04-02 03:00:00 PDT" [5] "2006-04-02 04:00:00 PDT" "2006-04-02 05:00:00 PDT" I presume it gets PST/PDT from my (Windows) system; I can't set it with > force_tz(ymd_hms("2007-03-11 01:00:00"),tzone="PST") (from the lubridate package), but see > force_tz(ymd_hms("2006-04-02 01:00:00"),tzone="America/Los_Angeles") [1] "2006-04-02 01:00:00 PST" What I'd like to do is keep all the time in standard time so I don't lose the 2 a.m. data. Presuma
 bly the
damage is done by the time it's read in. For example, > force_tz(temps$timedate[2185:2190], tzone="UTC") [1] "2006-04-02 00:00:00 UTC" "2006-04-02 01:00:00 UTC" [3] NA "2006-04-02 03:00:00 UTC" [5] "2006-04-02 04:00:00 UTC" "2006-04-02 05:00:00 UTC" Any advice? Thanks, Bill_____________________________________________
R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. 


	[[alternative HTML version deleted]]

