tidyverse / hms

A simple class for storing time-of-day values
https://hms.tidyverse.org/
Other
138 stars 25 forks source link

Preserve NA when converting to strings #51

Closed jeroen closed 6 years ago

jeroen commented 6 years ago

I may be overlooking something, but why are NAs not preserved?

krlmlr commented 6 years ago

Good point. We need an NA string for format(), but maybe this still works with your patch? Existing tests seem to pass, would you like to add an explicit test for as.character() and maybe format()?

jimhester commented 6 years ago

FWIW the current behavior was the ultimate cause of a reported readr bug https://github.com/tidyverse/readr/issues/715, which should be fixed once this is merged.

krlmlr commented 6 years ago

Thanks!