How to build a time-series data frame from start and end dates?

For make a good response is better see the reproducible example of data:

Im could suggest you check the lubridate library for get the year_week format from date data.

# But if you data frame is df, this code help you. If all 10.000 observation have this format 2000-01-01 this code # run well
df$year_week <- format(df$date, "%Y-%U")
1 Like