Hello,

What is the best way to concatenate POSIXct objects keeping the time zone
attribute in a program?  For example:


R> xx <- as.POSIXct(strptime(c("2006-09-26 12:00:00", "2006-09-26 13:00:00"),
+                           format="%Y-%m-%d %H:%M:%S"), tz="GMT")
R> xx
[1] "2006-09-26 12:00:00 GMT" "2006-09-26 13:00:00 GMT"


but, as ?c.POSIXct explains:


R> c(xx, xx[1] - 60, xx[2] + 60)
[1] "2006-09-26 07:00:00 CDT" "2006-09-26 08:00:00 CDT"
[3] "2006-09-26 06:59:00 CDT" "2006-09-26 08:01:00 CDT"


Is there something better/safer than simply setting the "tzone" attribute
of the new object?


Cheers,

-- 
Seb

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to