You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What seems to be new in R is that infinite dates are formatted as "Inf" when coerced to string. This causes problems in write-read roundtrips, as readr's parser guessing does not accept "Inf" as a valid date:
Assuming this is correct there are some solutions. Personally I would prefer a change on the read side, where read_delim etc. accept "Inf" and "-Inf" as valid dates. It violates iso8601, but it would be nice to preserve the distinction between missing dates and infinite dates.
If that's not an option, there are also solutions on the write side.
output infinite dates as something more in line with iso8601 like "9999-13-00";
output as NA (which is functionally as it was before)
give an error if infinite dates are written
Some parameter to control this is of course possible, but the important choice then, in my view, is what the default option would be.
The text was updated successfully, but these errors were encountered:
Yeah it is since R 4.2.0:
"Not strictly fixing a bug, format()ing and print()ing of non-finite Date and POSIXt values NaN and ±Inf no longer show as NA but the respective string, e.g., Inf, for consistency with numeric vector's behaviour, fulfilling the wish of (https://bugs.r-project.org/show_bug.cgi?id=18308)."
What seems to be new in R is that infinite dates are formatted as "Inf" when coerced to string. This causes problems in write-read roundtrips, as
readr
's parser guessing does not accept "Inf" as a valid date:Assuming this is correct there are some solutions. Personally I would prefer a change on the read side, where
read_delim
etc. accept "Inf" and "-Inf" as valid dates. It violates iso8601, but it would be nice to preserve the distinction between missing dates and infinite dates.If that's not an option, there are also solutions on the write side.
Some parameter to control this is of course possible, but the important choice then, in my view, is what the default option would be.
The text was updated successfully, but these errors were encountered: