1

I have tried to find a solution for my problem but could not have found any. So in R I am getting NA when I will run a script below:

as.numeric(as.POSIXlt("Thu May 28 10:39:58 EEST 2015", format="%a %b %d %H:%M:%S EEST %Y"))

I have found that the format may not be correct but I will not understand how I should change it. Could anyone know what I am doing wrong?

Thank you for your answers!

E.Ran
  • 11
  • 1
  • It's probably not very helpful but the output I'm getting from your code above is `[1] 1432827598`. Maybe try and restart your working session in R and see if that helps. – s_scolary Nov 30 '15 at 20:11
  • Would like to add I'm getting that too. – giraffehere Nov 30 '15 at 20:16
  • Well, I have tried to restart my session and computer also but it wont help nothing. Problem is maybe with my settings or something? – E.Ran Nov 30 '15 at 20:24
  • Have you updated R recently? – giraffehere Nov 30 '15 at 20:29
  • I have installed it two months ago and have not updated it after installation. Do you believe that I should have to? – E.Ran Nov 30 '15 at 20:34
  • I believe that my R does not support the formats where months or weekdays have been wrote (%a, %b and so on). Do anyone have same problem? How do you have solved it? – E.Ran Nov 30 '15 at 20:59
  • Sounds like a difference in OS or locales. The date-time conversions do have an OS dependence. You should post the first few lines of `sessionInfo()`-output. – IRTFM Nov 30 '15 at 21:03
  • R version 3.2.2 (2015-08-14) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=Finnish_Finland.1252 LC_CTYPE=Finnish_Finland.1252 [3] LC_MONETARY=Finnish_Finland.1252 LC_NUMERIC=C [5] LC_TIME=Finnish_Finland.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.2.2 – E.Ran Nov 30 '15 at 21:05
  • `LC_TIME=Finnish_Finland.1252` So what are the abbreviations for days of the week and months in Finnish? – IRTFM Nov 30 '15 at 22:38
  • Well, it works with the Finnish names, thank you! I changed the value of LC_TIME locale and now it works fine. – E.Ran Dec 01 '15 at 05:26

0 Answers0