0

I am trying to use the diff_in_days function as such:

all$diff_in_days<- difftime(all$Admit_Date_2, all$Discharge_Date_1, units = c("days"))

Admit_Date_2 variable has NA's so when I converted from the xlsx file, it became a character and is in the 5 digit format (i.e. 43052) and Discharge_Date_1 is in the Date class. I am getting the following error:

Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format

Would anyone know how to fix this?

Rui Barradas
  • 57,195
  • 8
  • 29
  • 57

0 Answers0