'In `timetk` ,the result of function `tk_make_weekend_sequence` show nothing
Solution 1:[1]
To fix this you need to set an English environment for the "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.
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lstat |

