dgkf / parttime

Work-in-progress R package for handling partial datetimes
https://dgkf.github.io/parttime
Other
17 stars 1 forks source link

Handle pmin and pmax more responsibly #35

Closed dgkf closed 2 years ago

dgkf commented 2 years ago

Reviewing how I handled pmin and pmax, I think the reexporting is a sloppy approach. base::pmin/pmax will respect classes that implement S4 versions of comparison operators, so these behaviors should "come for free" without doing any disrespectful masking.

I need to research this more to explore whether it's compatible, but at first glance it looks like it provides a more compatible path forward.

dgkf commented 2 years ago

Upon investigation, it looks like I had good reason for doing this in the first place.

The default pmin/pmax, though they will work "out of the box" with S3/S4 values that implement comparison operators, rep and is.na, this uses the result of is.na directly to determine how to handle missingness, which is not a binary yes or no in the case of a partial time.