Re: [R] unwanted switch to DST with POSIXct objects

2011-06-05 Thread Denis Chabot
Thanks Jeff and Spencer, I will probably set the time zone for my session, but I had forgotten the possibility of setting the time zone attribute of a POSIXct object, which would have solved my problem also. Denis Le 2011-06-05 à 11:14, Spencer Graves a écrit : > On 6/5/2011 9:30 AM, Jeff Newmi

Re: [R] unwanted switch to DST with POSIXct objects

2011-06-05 Thread Spencer Graves
On 6/5/2011 9:30 AM, Jeff Newmiller wrote: Sys.setenv(TZ="Etc/GMT+5") Or: x <- as.POSIXct(as.Date('2011-01-15')) attr(x, 'tzone') <- "Etc/GMT+5" x This version works without Sys.setenv, which may not work on some platforms. Unfortunately, I believe there are some copy operations that

Re: [R] unwanted switch to DST with POSIXct objects

2011-06-05 Thread Jeff Newmiller
Sys.setenv(TZ="Etc/GMT+5") Make the timezone you prefer the default for that R session. FWIW: EST may or may not exist as a valid timezone on your system, but it is an ambiguous notation anyway. --- Jeff Newmiller The .

[R] unwanted switch to DST with POSIXct objects

2011-06-05 Thread Denis Chabot
Hi, For a project I try to keep everything in normal time, not daylight saving time, to prevent problem when instruments collected data during the nights when we go from DST to normal time. But sometimes R tricks me and I do not know how to prevent it. This is one example: lights_on = as.POSI