I want to generate the following sequence on Lubridate
seq(ymd('2017-03-12'),ymd('2020-02-23'), by = '1 week')
and store the weeks generated as a column in an existing data.frame of 102 rows.
When I try to use dataframe["newcolumnname] <- seq(ymd('2017-03-12'),ymd('2020-02-23'), by = '1 week')
It throws an error: Error in [<-.data.frame(* tmp *, "Year", value = c(17237, 17244, 17251, : replacement has 155 rows, data has 102
What's the most efficient way to generate a sequence of dates in a column in R?