What gives in this example? How come it does not generate what I expect it to, and how can I change that behaviour?
date_seq <- seq(ymd('2023-03-22'), ymd('2023-03-27'), as.difftime(days(1)))
[1] "2023-03-22" "2023-03-23" "2023-03-24" "2023-03-25" "2023-03-26" "2023-03-27"
Then I loop through it for(i in date_seq) print(i)
and surprise, surprise:
...
[1] 19442
[1] 19443
No dates to be found!
You need to apparently use for (i in seq_along(date_seq)) print(date_seq[i])
and voila!
...
[1] "2023-03-26"
[1] "2023-03-27"