I am using "R" and am hoping someone can assist with my date formatting issue. I have a character variable from a dataset that I Imported from Excel.
DateVar <- c("12-07-2017", "43229", "43137", "03-27-2018")
The excel file I am using has two date formats in the same variable (MM-DD-YYYY and YYYY-MM-DD), hence the two formats in "DateVar". The date formatted YYYY-MM-DD converts to the excel date (i.e 43229).
I would like to have all the values be the same date format (ideally YYYY-MM-DD), but I am having issues converting them consistently.
Your help is much appreciated.