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

unique() always zero for periods #1154

Open
robchallen opened this issue Feb 1, 2024 · 1 comment
Open

unique() always zero for periods #1154

robchallen opened this issue Feb 1, 2024 · 1 comment

Comments

@robchallen
Copy link

unique() for periods always returns zero.
I'd expect it to either work or throw an error if not implemented.
Workaround exists as below. Hope useful. Many thanks.

test = c(rep(lubridate::as.period("2 day"),3), rep(lubridate::as.period("1 day"),3))

# Undesirable behaviour:
if (unique(test)==0) warning("This is unexpected")

# Workaround
lubridate::as.period(unique(as.character(test)))
@robchallen
Copy link
Author

lubridate_1.9.3

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