tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
527 stars 49 forks source link

range() on yearweek objects drops week_start #300

Closed jrauser closed 6 months ago

jrauser commented 12 months ago

I think a range() that operates specifically on yearweek objects is required.

library(tsibble)
#> 
#> Attaching package: 'tsibble'
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, union
wk <- make_yearweek(2023, 21:50, week_start=7)
wk[1]
#> <yearweek[1]>
#> [1] "2023 W21"
#> # Week starts on: Sunday
range(wk)
#> <yearweek[2]>
#> [1] "2023 W20" "2023 W49"
#> # Week starts on: Monday

Related to: https://github.com/tidyverts/fable/issues/397

earowang commented 6 months ago

fixed in #299