tidyverse / hms

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

parser can be improved #39

Closed qgeissmann closed 3 years ago

qgeissmann commented 7 years ago

I attempted a prototypical parser that addresses these issues (https://github.com/qgeissmann/dhms). I am happy to work on it and merge it.

krlmlr commented 7 years ago

Agreed that we should be able to round-trip correctly.

@hadley: Should as.hms.character() give a warning if it cannot parse its arguments, perhaps optionally?

hadley commented 7 years ago

I think you should follow the convention of readr (and base R), which, IIRC, is to warn whenever there is a failure. It'd be more work, but it's probably worth it, to return a problems data frame as an attribute like in readr, as that way you can also use stop_for_problems().

qgeissmann commented 7 years ago

Thanks, I will study how it is implemented in readr and follow the convention before I submit a PR

krlmlr commented 3 years ago

The parser here is very simple, sophisticated parsing is outside the scope of this package.

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.