I'm loading an Excel file which has a column where dates are stored as integers (43000 for example is 2017-09-22). I tried applying the answer to this question this way:
df = df %>%
mutate(date = as.Date(date, origin = "1899-12-30"))
But I'm having the following error:
Error in mutate_impl(.data, dots) : Evaluation error: character string is not in a
standard unambiguous format. Calls: (...)
I searched for this problem and all results are about incorrectly specifying a string input to as.Date but in this situation the input is an integer.
Just found the problem: the dates were somehow loaded as string instead of integers. This solved my problem:
df = df %>%
mutate(date = as.Date(as.numeric(date), origin = "1899-12-30"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With