1

I am found very strange behaviour of date printing and conversion to character, while iterating them in cycle.

> foo = as.POSIXct(c("2015-10-10 UTC","2015-10-11 UTC"))
> foo
[1] "2015-10-10 GMT" "2015-10-11 GMT"

> for (i in foo) print(i)
[1] 1444435200
[1] 1444521600

> for (i in 1:2) print(foo[i])
[1] "2015-10-10 GMT"
[1] "2015-10-11 GMT"

Why and how syntax influencing later conversion to character?

Anatoliy Orlov
  • 469
  • 2
  • 5

0 Answers0