我认为我已经做好了一切,但为什么我会这样做:
> Sys.time()
[1] "2015-11-09 18:51:17 UTC"
Warning messages:
1: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'localtime'
2: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'localtime'
>
操作系统是Windows Server 2012(实际上是Azure VM)。我已将时区设置为UTC,其中包含TZ
环境变量:
Sys.timezone
显然看到了:
> Sys.timezone()
[1] "UTC"
>
它甚至列在我的OlsonNames()
:
我在降价时收到大量这些错误消息,这让我发疯了。不幸的是,我注意到与此相关的其他SO链接经常没有得到解决。
更新 - 每次请求我都会添加sessionInfo()
输出:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2012 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.2 yaml_2.1.13 rmarkdown_0.8.1
[5] digest_0.6.8
>
和追溯:
> options(warn=2)
> Sys.time()
Error in as.POSIXlt.POSIXct(x, tz) :
(converted from warning) unknown timezone 'localtime'
> traceback()
13: doWithOneRestart(return(expr), restart)
12: withOneRestart(expr, restarts[[1L]])
11: withRestarts({
.Internal(.signalCondition(simpleWarning(msg, call), msg,
call))
.Internal(.dfltWarn(msg, call))
}, muffleWarning = function() NULL)
10: .signalSimpleWarning("unknown timezone 'localtime'", quote(as.POSIXlt.POSIXct(x,
tz)))
9: as.POSIXlt.POSIXct(x, tz)
8: as.POSIXlt(x, tz)
7: format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...)
6: structure(format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...),
names = names(x))
5: format.POSIXct(x, usetz = TRUE)
4: format(x, usetz = TRUE)
3: print(format(x, usetz = TRUE), ...)
2: print.POSIXct(x)
1: function (x, ...)
UseMethod("print")(x)
>