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

Comparing nanotime with a POSIXct #57

Closed
statquant opened this issue Nov 22, 2019 · 4 comments
Closed

Comparing nanotime with a POSIXct #57

statquant opened this issue Nov 22, 2019 · 4 comments

Comments

@statquant
Copy link
Contributor

@statquant statquant commented Nov 22, 2019

Hello,
in addition to #52 can I suggest to add comparator for POSIXct ?

nanotime(Sys.time()) > (Sys.time() - 10)
[1] FALSE
Warning messages:
1: In if (class(e2) == "nanotime") { :
the condition has length > 1 and only the first element will be used
2: In eval(call, callEnv) :
Incompatible methods (">.integer64", "Ops.POSIXt") for ">"

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Nov 22, 2019

Would you mind mocking or testing it? Given that POSIXct is a hybrid S3 class, I am not sure we can from S4. (We might, I just don't know ...)

@statquant
Copy link
Contributor Author

@statquant statquant commented Nov 22, 2019

Ok, will come back with a PR if I can manage, S3/S4 concepts are new to me.
Thanks

@lsilvest
Copy link
Collaborator

@lsilvest lsilvest commented Feb 19, 2020

This works when defining the appropriate methods. I've added these comparisons in the feature/temporal_types branch and they will be available soon when it is merged in master.

@statquant
Copy link
Contributor Author

@statquant statquant commented Feb 20, 2020

Thank you, I was hoping to be of some help but never got to try.
Many thank for all the hard for the community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.