Hi I have a piece of code that rounds a range of dates in dataframe the strange is that it works for a one dataframe but for the another dataframe it gives an error
so for one dataframe I have this code
> range(data1$seamless_user_reg_date)
[1] "2021-05-03" "2022-07-11"
> lubridate::floor_date(range(data1$seamless_user_reg_date), "month")
[1] "2021-05-01" "2022-07-01"
and for the other dataframe where i get the error I have this code
> range(data1$opt_meeting_booked_date)
[1] "2021-06-24" "2022-05-03"
> lubridate::floor_date(range(data1$opt_meeting_booked_date), "month")
Error in object[[name, exact = TRUE]] : subscript out of bounds
what I would need on the second result is
"2021-06-01" "2022-05-01"
Any help on why this could be happening?