Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit coercion when operating with strings #38

Closed
qgeissmann opened this issue Jul 25, 2017 · 3 comments
Closed

Implicit coercion when operating with strings #38

qgeissmann opened this issue Jul 25, 2017 · 3 comments

Comments

@qgeissmann
Copy link
Contributor

I personally find it quite useful to be able to implicitly coerce strings to time objects.
I believe this is implemented in POSIXct. For instance: as.POSIXct("2016-01-01") == "2016-01-01" is TRUE.
In hms, we could be writing x > "23:50:21.100" instead of x > hms(21.100, 50,23) (or explicitly using as.hms()).
Now, we have:

> hms(1) > "00:00:02"
#> TRUE 

I am happy to implement this new feature if you want

@krlmlr
Copy link
Member

krlmlr commented Jul 25, 2017

I'd rather be explicit here, and not coerce implicitly.

@qgeissmann qgeissmann changed the title Implicit coercion when opperating with strings Implicit coercion when operating with strings Jul 25, 2017
@krlmlr
Copy link
Member

krlmlr commented Nov 15, 2017

Seems we can't define Ops.hms() without breaking things (#18). Would we need that to change the behavior of > ?

@krlmlr krlmlr closed this as completed Apr 16, 2019
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants