Create a sequence of dates in R

Create a sequence of dates in R

Drats! Where did I put that snippet?

# Create a sequence of dates
dates <- seq(as.Date("2024-01-01"), by = "day", length.out = 30)
dates |> str()
#>  Date[1:30], format: "2024-01-01" "2024-01-02" "2024-01-03" "2024-01-04" "2024-01-05" ...
library(JuliaCall)
d <- julia_eval("using Dates;Date.(2024, 1, 1:30)")
#> Julia version 1.9.4 at location /Applications/Julia-1.9.app/Contents/Resources/julia/bin will be used.
#> Loading setup script for JuliaCall...
#> Finish loading setup script for JuliaCall.
identical(dates,d)
#> [1] TRUE

Created on 2023-12-06 with reprex v2.0.2