I find myself confronted with a problem for which I fail to find a clue to a solution - which makes it very hard to actually deal with it.. Here goes: In R (with R-Studio) I try to create a Date object with the library lubridate
:
library(lubridate)
ymd(20161001)
which results in an error:
Error in as.POSIXlt.POSIXct(x, tz) : (converted from warning) unknown timezone 'GMT'
A second run (and any subsequent runs) of the last command yields the correct result:
ymd(20161001)
[1] "2016-01-01"
until I restart my R-session, when again the first run triggers an error. I've checked several settings, but can't find anything changing from the first to the second run. Here's, for instance, the output of my sessionInfo()
:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Dutch_Netherlands.1252 LC_CTYPE=Dutch_Netherlands.1252 LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.6.0
loaded via a namespace (and not attached):
[1] magrittr_1.5 tools_3.3.2 stringi_1.1.2 stringr_1.1.0
Sys.timezone()
says [1] "Europe/Berlin"
, and Sys.getenv('TZ')
is empty: ""
I do find others stumbling upon the same warning, such as this blogpost or here, but these problems have to do with times, whereas I would prefer to ignore times altogether, and deal with dates only.