-
Notifications
You must be signed in to change notification settings - Fork 109
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
Allow subsecond intervals with date_breaks() #160
Changes from 3 commits
06d468d
7b73efb
105d88a
ba54b00
7570cee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,12 @@ floor_date <- function(date, time) { | |
as.Date(cut(date, time, right = TRUE, include.lowest = TRUE)) | ||
} | ||
} | ||
|
||
floor_time <- function(date, time) { | ||
to_time <- function(x) { | ||
force(x) | ||
structure(x, class = c("POSIXt", "POSIXct")) | ||
structure(x, class = c("POSIXt", "POSIXct"), | ||
tzone = attr(date, "tzone", exact = TRUE) %||% "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure you need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did this to match what is being called for other units in L32 but no I did not fully think through whether it's necessary in either place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, let's keep it consistent then |
||
} | ||
|
||
prec <- parse_unit_spec(time) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please indent so each argument to
structure()
goes on its own line?