Re: [Rd] Date class shows Inf as NA; this confuses the use of is.na()

2018-06-08 Thread Werner Grundlingh
Indeed. as_date is from lubridate, but the same holds for as.Date. The output and it's interpretation should be consistent, otherwise it leads to confusion when programming. I understand that the difference exists after asking a question on Stack Overflow: https://stackoverflow.com/q/50766089/91

[Rd] Date class shows Inf as NA; this confuses the use of is.na()

2018-06-08 Thread Werner Grundlingh
In the following example, the date class shows Inf as NA > as_date(Inf, origin = '1970-01-01') [1] NA This is misleading as is.na() reports incorrectly > is.na(as_date(Inf, origin = '1970-01-01')) [1] FALSE The correct approach here would probably to have an Inf (and -Inf) *displayed* rather th