I had posted this previously. The code fix (posted below) worked fine until recently. All packages have been update (Tidyr, etc.).
A sample data frame is as follows:
transaction_id = c("1", "2"),
trade_date = as.Date(c("2019-07-01", "2019-08-01")),
start = as.Date(c("2019-08-01", "2019-12-01")),
end = as.Date(c("2019-10-31", "2020-02-28")),
price = c(5, 6),
currency = c("CAD", "CAD"),
volume = c(10000, 5000)
)
I wanted to expand the dateframe monthly for each transaction from start to end. The proposed code fix below worked fine until recently.
df %>%
group_by(transaction_id) %>%
mutate(start=list(seq(start, end, "months"))) %>%
unnest_longer(c(start)) %>%
mutate(end = ceiling_date(start, "month") - 1)
It's now creating the following error:
Error in as.Date.default(value) :
do not know how to convert 'value' to class “Date”
Any suggestions on what has happened, or how to fix this?
Thanks