-
Notifications
You must be signed in to change notification settings - Fork 6
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
Precision on date_group()
is clamped at max value for unit instead of performing numerical conversion when n > max
#359
Comments
The point of i.e. the "counter" which decides how to break up the groups resets at every hour. Here is one of the Examples that tries to demonstrate this x <- as.POSIXct("2019-01-01", "America/New_York")
x <- add_days(x, -3:5)
# Group by 2 days of the current month.
# Note that this resets at the beginning of the month, creating day groups
# of [29, 30] [31] [01, 02] [03, 04].
date_group(x, "day", n = 2) If you just want to create buckets of 120 minutes anchored from an initial origin of
|
Got it. My package function is a glorified wrapper of
I guess they should not change from minutes to hours like it's no big deal hoping for internal conversion. I am not sure whether edge cases should favor
|
I am not sure if this is by design or not, but I really like the behavior of
date_group()
and it just exploded in my face when trying to use it with more than 60 minutes. Here's a reproducible example:It would be nice for
clock
to automatically perform the conversion. If difficult to change, I think there should be some sort of verbose warning to the user, since the grouping gets performed silently and gives the illusion of it working properly.This gets properly handled as I would expect with
date_floor
(conversion being made), so I'm not sure ifdate_group()
is doing what it is supposed to be doing and I should be usingdate_floor
instead.The text was updated successfully, but these errors were encountered: