On the R-devel mailinglist, it was noted that as.Date(Inf, origin='1970-01-01') is stored as a valid Date-object, and is.na() returns FALSE, but when printing this object it shows 'NA", which is confusing. It turns out this is because when formatting a Date-object it is converted to a POSIXlt-object, which fails for Inf, as well as other out-of-range values. Therefore this function defaults to a numerical value if the date is outside the range 1-1-1 up till 9999-12-31, with a warning
1 2 |
x |
Date to format |
... |
Other arguments passed on to format.POSIXlt |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.