You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/07 09:36:52 UTC
[GitHub] [arrow] AlenkaF commented on a change in pull request #12097: ARROW-14590: [R] Implement lubridate::week
AlenkaF commented on a change in pull request #12097:
URL: https://github.com/apache/arrow/pull/12097#discussion_r780134565
##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -101,6 +101,10 @@ register_bindings_datetime <- function() {
Expression$create("day_of_week", x, options = list(count_from_zero = FALSE, week_start = week_start))
})
+ register_binding("week", function(x) {
+ (call_binding("yday", x) - 1) %/% 7 + 1
+ })
+
Review comment:
I initially used "week" with `first_week_is_fully_in_year=True` but it didn't match and I didn't want to manually adjust that as I feel it uses a different logic than `lubridate::week`. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org