I have a set of standard unix integer timestamps, all in UTC (GMT), that I'm feeding into R that I wish to plot. I've been using code of the form:
`d$date_time <- as.POSIXct(d$date_time,origin="1970-01-01",tz="GMT")
to covert my column of standard unix timestamp UTC integers into what I assume is some kind of plottable set of objects. I can plot this and the data looks approximately good, but I have no idea whether all of my data is being offset in any way by the local timezone of my computer or any other timezone adjustments. This is because I don't understand what adjustments get made to the data (if any) when a) I make the call to `as.POSIXct()` and b) when I plot the data. So these are my questions:
1. When I specify `tz="GMT"` above, what exactly is this telling the computer to do? I see three possibilities:
i) "your data is in GMT and you want it converted to your local time"
ii) "your data is always assumed to be local time and you want it converted to GMT" iii) "your data is always assumed to be GMT and you want me to leave it in GMT, so don't make any adjustments".
2. When I plot the data (with `xyplot`), does the plotting function make any visual adjustments to the time? If so, what adjustments?
I think if someone could explain how the internal data structures store timezone information as well as how those data structures are transformed by various commands it would help clear things up. Basically, I would like to work with UTC from the beginning right up to the point of display, where I might wish to make adjustments for timezones, though ideally explicitly rather than the computer silently deciding for me. AFAIK, the data is always stored in universal time, and simply displayed in local time when it gets to printing. I'll try to dig out a related question.
以上就是How do POSIXct timezones work in R的详细内容，更多请关注web前端其它相关文章！