How do POSIXct timezones work in R

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏