?timezones
州"Most platforms support time zones of the form GMT+n and GMT-n, which assume at a fixed offset from UTC (hence no DST)."
我今年早些时候使用的代码是tz="GMT-8"
。只有对我的计算机的更改已更新为R版"R version 3.2.2 (2015-08-14)"
,并通过向"C:\Program Files\R\R-3.2.2\library\base\R"
中的Rprofile添加一行代码,从旧用户帐户迁移我的库。只是详细的代码是.libPaths(c("C:/Users/XXXX XXXX/Documents/R/win-library/3.2",.Library.site))
。为什么我的系统突然不接受这种tz格式?我可以更改哪些系统设置来解决此问题?
下面的工作示例。
tdat<-c("11/19/2014 12:45", "11/19/2014 13:00", "11/19/2014 13:15",
"11/19/2014 13:30", "11/19/2014 13:45", "11/19/2014 14:00", "11/19/2014 14:15",
"11/19/2014 14:30", "11/19/2014 14:45", "11/19/2014 15:00")
as.POSIXct(strptime(tdat,"%m/%d/%Y %H:%M",tz="GMT-8"))
Warning messages:
1: In strptime(tdat, "%m/%d/%Y %H:%M", tz = "GMT-8") :
unknown timezone 'GMT-8'
2: In as.POSIXct.POSIXlt(strptime(tdat, "%m/%d/%Y %H:%M", tz = "GMT-8")) :
unknown timezone 'GMT-8'
3: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'GMT-8'
答案 0 :(得分:7)