4

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.

J.Pan
  • 51
  • 1
  • `as.POSIXct("2017-11-01 10:52", "%Y-%m-%d %H:%M", tz = "Asia/Kolkata")` works for me. – Ronak Shah Nov 01 '17 at 07:41
  • No it doesn't work @Ronak. It gives this. `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'` – Lazarus Thurston Nov 10 '17 at 06:17
  • Some of my code has recently started generating this warning too. Haven't figured out the issue but I suspect a package has changed. – neilfws Nov 20 '17 at 06:18
  • Same thing happening to me. – Kay Nov 20 '17 at 14:07

1 Answers1

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!

Tito Sanz
  • 1,280
  • 1
  • 16
  • 33