Greetings R-devel group.  When dealing with Inf dates, as.POSIXct seems to 
return Inf, but is printed as NA:

> x1 <- as.POSIXct(Inf, origin = '1970-01-01')
> print(x1)
[1] NA
> is.na(x1)
[1] FALSE
> is.infinite(x1)
[1] TRUE
>

POSIXlt at least evaluates and prints the result consistently:

> x1 <- as.POSIXlt(Inf, origin = '1970-01-01')
> print(x1)
[1] NA
> is.na(x1)
[1] TRUE
>

I think the cause is due to format.POSIXct function calling format.POSIXlt, 
hence printing as NA, but actually storing an Inf.  I don't have an opinion on 
what the actual result of as.POSIXct(Inf) should be, as long as what's printed 
matches that value.

Thank you

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to