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

Methods to compare year* with dates #267

Open
arnaud-feldmann opened this issue Nov 2, 2021 · 0 comments
Open

Methods to compare year* with dates #267

arnaud-feldmann opened this issue Nov 2, 2021 · 0 comments

Comments

@arnaud-feldmann
Copy link

yearmonth("2021 04")>date("2021/03/01")
#[1] TRUE
#Warning message:
#Incompatible methods (">.vctrs_vctr", ">.Date") for ">"
yearmonth("2021 04")>date("2021/04/01")
#[1] FALSE
#Warning message:
#Incompatible methods (">.vctrs_vctr", ">.Date") for ">"
yearmonth("2020 04")>date("2021/03/01")
#[1] FALSE
#Warning message:
#Incompatible methods (">.vctrs_vctr", ">.Date") for ">"
yearquarter("2021Q1")>date("2021/03/01")
 #[1] FALSE
#Warning message:
#Incompatible methods (">.vctrs_vctr", ">.Date") for ">" 
yearquarter("2021Q2")>date("2021/03/01")
#[1] TRUE
#Warning message:
#Incompatible methods (">.vctrs_vctr", ">.Date") for ">" 

It gives the right result but gives a warning.

It would be very fine for it to work without explicit conversions in order to be able to write generic functions that work on yearmonth, yearquarter.

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

No branches or pull requests

1 participant