We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now that we have both isoyear and isoweek, it would be good to include them as options for floor_date, ceil_date and round_date.
isoyear
isoweek
floor_date
ceil_date
round_date
For example: floor(ymd('2016-01-02'),'isoweek') is 2015-12-28 floor(ymd('2016-01-02'),'isoyear') is 2014-12-29
floor(ymd('2016-01-02'),'isoweek')
2015-12-28
floor(ymd('2016-01-02'),'isoyear')
2014-12-29
Will need to create assignment functions for isoweek<- and isoyear<-.
isoweek<-
isoyear<-
Happy to work on this if it's a good idea!
The text was updated successfully, but these errors were encountered:
Yes. Of course. Thanks.
Sorry, something went wrong.
Related #268
You can do this with clock's iso-year-week-day calendar type
library(clock) library(magrittr) ywd <- year_month_day(2016, 1, 2) %>% as_iso_year_week_day() ywd #> <iso_year_week_day<day>[1]> #> [1] "2015-W53-6" # Grouping by the ISO week component ywd %>% calendar_group("week", n = 1) %>% calendar_widen("day") %>% as.Date() #> [1] "2015-12-28" # Grouping by the ISO year component ywd %>% calendar_group("year", n = 1) %>% calendar_widen("day") %>% as.Date() #> [1] "2014-12-29" # Setting components set_week(ywd, 2) #> <iso_year_week_day<day>[1]> #> [1] "2015-W02-6" set_year(ywd, 2017) #> <iso_year_week_day<day>[1]> #> [1] "2017-W53-6"
Created on 2021-05-25 by the reprex package (v1.0.0)
https://clock.r-lib.org/reference/index.html#section-iso-year-week-day
No branches or pull requests
Now that we have both
isoyear
andisoweek
, it would be good to include them as options forfloor_date
,ceil_date
andround_date
.For example:
floor(ymd('2016-01-02'),'isoweek')
is2015-12-28
floor(ymd('2016-01-02'),'isoyear')
is2014-12-29
Will need to create assignment functions for
isoweek<-
andisoyear<-
.Happy to work on this if it's a good idea!
The text was updated successfully, but these errors were encountered: