Split a column with dates to two columns end and start date

To address this, next time please provide a proper REPRoducible EXample (reprex) illustrating your issue.

Now about your question, does this solve your problem?

library(dplyr)

# Sample date vector
as_date <- c("2022-03-11 UTC", "2022-03-16 UTC", "2022-03-21 UTC",
             "2022-03-26 UTC", "2022-04-05 UTC", "2022-04-10 UTC",
             "2022-04-15 UTC", "2022-04-25 UTC",  "2022-04-30 UTC",
             "2022-05-10 UTC", "2022-05-15 UTC", "2022-05-20 UTC",
             "2022-05-25 UTC")

# Relevant code
as.data.frame(as_date) %>% 
    transmute(start_date = as_date,
              end_date = lead(start_date)) %>% 
    head(-1)
#>        start_date       end_date
#> 1  2022-03-11 UTC 2022-03-16 UTC
#> 2  2022-03-16 UTC 2022-03-21 UTC
#> 3  2022-03-21 UTC 2022-03-26 UTC
#> 4  2022-03-26 UTC 2022-04-05 UTC
#> 5  2022-04-05 UTC 2022-04-10 UTC
#> 6  2022-04-10 UTC 2022-04-15 UTC
#> 7  2022-04-15 UTC 2022-04-25 UTC
#> 8  2022-04-25 UTC 2022-04-30 UTC
#> 9  2022-04-30 UTC 2022-05-10 UTC
#> 10 2022-05-10 UTC 2022-05-15 UTC
#> 11 2022-05-15 UTC 2022-05-20 UTC
#> 12 2022-05-20 UTC 2022-05-25 UTC

Created on 2022-05-29 by the reprex package (v2.0.1)

1 Like