In timetk ,the result of function tk_make_weekend_sequence show nothing . Anyone can help? Thanks!
timetk
tk_make_weekend_sequence
library(timetk) weekends <- tk_make_weekend_sequence( start_date = "2017-01-01", end_date = "2017-12-31" ) weekends
To fix this you need to set an English environment for the "LC_TIME"
"LC_TIME"
Sys.setlocale("LC_TIME", "English") weekends <- tk_make_weekend_sequence( start_date = "2017-01-01", end_date = "2017-12-31" ) weekends
Function tk_make_weekend_sequence uses a lubridate::wday function which work with your local language settings.
lubridate::wday
ret_tbl <- tibble::tibble(date_sequence = date_sequence) %>% dplyr::mutate(weekday = lubridate::wday(date_sequence, label = TRUE)) %>% dplyr::filter((weekday == "Sat" | weekday == "Sun"))
The problem is triggered by the filter in the last row. If you don't change "LC_TIME", weekday will be the abbreviation of the day name in your native language.
filter
Copyright © 2021 Jogjafile Inc.
To fix this you need to set an English environment for the
"LC_TIME"
Function
tk_make_weekend_sequence
uses alubridate::wday
function which work with your local language settings.The problem is triggered by the
filter
in the last row. If you don't change"LC_TIME"
, weekday will be the abbreviation of the day name in your native language.