I have a large data set with over thousands of date, with 5 diffenrent date types formats ("%d/%m/%y", "yyyy-mm-dd", "44312"(for exemple), "275501" (for exemple), and the last format "mm/dd/yyyy").
How can I change into a single date format ? I would like to keep this date format ;
"2021-04-01"
dput(head(data.na))
structure(list(date = c("29/03/21", "29/03/21", "29/03/21", "29/03/21",
"29/03/21", "29/03/21"), id = c("usr012", "usr012", "usr012",
"usr012", "usr015", "usr020"), product = c("Oignon frais - Botte de 300g 1 pièce",
"Mâche - Poche de 200g 1 pièce", "Aillet - Botte de 200g 1 pièce",
"Courge butternut - Petite pièce de 800g à 1,2kg environ", "Scarole 1 pièce",
"Aillet Botte de 200g 1 pièce"), price = c(2, 2, 2, 3, 1.1, 2
), quantity = c(1, 1, 1, 0.77, 1, 1), total = c(2, 2, 2, 2.31,
1.1, 2)), row.names = c(NA, 6L), class = "data.frame")