I have a problem in generating proper time sequence using R:
fivemin <- seq(as.POSIXct("2014/01/01 0:00:00"), as.POSIXct("2014/04/01 0:00:00"), by="5 mins",tz="EST")
time <- data.frame(MasterTime=fivemin)
Using above code, I can get a data frame with 25909 observations. However, under Eastern Standard Time (without daylight saving), the number of observations should be 25920. The difference is 1 hour from the transition of daylight saving time on 03/09/20014, because then the time would change from 1 AM to 3 AM directly. I'm not sure how R deals with this kind of time change. How can I revise my code so R produce a time sequence without that missing 2AM hour on 03/09/2014? Does anyone have any idea on this?
Really thanks!
If you don't want to use daylight saving time try setting tz = 'UTC'
Apart from 'UTC' or 'GMT' it's better not to use the three letter designation for a timezone e.g "EST" because these are ambiguous. Australia has an Eastern Standard Time, as does the US. Instead use Country/City
Also check the dst function in the lubridate package.
If you would like to retain the time zone, but use standard time, try something like.