Warning on on POSIXlt(as.POSIXlt(x), …)

人盡茶涼 提交于 2019-12-10 15:45:42

问题


when R was throwing warning messages on this command

`setwd("~/Desktop/Project R")
Warning message:
In format.POSIXlt(as.POSIXlt(x), ...) :
unknown timezone 'default/Asia/Kolkata'`

So, I tried creating a date for this TZ by entering

as.POSIXct("2017-11-01 10:52", "%Y-%m-%d %H:%M", tz = "Asia/Kolkata")
[1] "2017-11-01 10:52:00 IST"
Warning messages:
1: In strptime(x, format, tz = tz) :
unknown timezone 'default/Asia/Kolkata'
2: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
unknown timezone 'default/Asia/Kolkata'
3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'default/Asia/Kolkata'

but the warning messages refuses to go? Is there a solution to permanently overcome these warnings.


回答1:


I've the some issue, if your on High Sierra it seems to be a bug between OS HS and R 3.4.2 as it is said in this post https://github.com/stan-dev/rstan/issues/455 Following the instructions (until R 3.4.3 will finally release) works for me. I do:

Sys.setenv(TZ="Europe/Madrid")

Now I can load packages, and use as.POSIXct and no messages pop up. Hope it helps!



来源:https://stackoverflow.com/questions/47048864/warning-on-on-posixltas-posixltx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!