Hi R community
I always have problems with the date time in r
structure(list(ï..Item = c("851375", "851375", "851375", "851375",
"851375", "851375"), Assortment = c("", "", "", "", "", ""),
Item.group = c("Breast", "Breast", "Breast", "Breast", "Breast",
"Breast"), Customer = c("D17", "D17", "D17", "D17", "D17",
"D17"), Date = c("15-08-2020", "16-01-2018", "24-01-2018",
"27-05-2020", "14-10-2020", "21-08-2020"), Sales = c("374",
"320", "221", "430", "307", "190"), Campaign.flag = c(0L,
0L, 0L, 0L, 0L, 0L)), row.names = c(NA, 6L), class = "data.frame")
str of the date is a chr and i want the date format to be day;month;year and save it as a date.
used the following code:
df$Date <- ymd(df$Date)
df <- arrange(df, Date)
but it returns NA