I have a column currentdate with date in class factor and formatted as 1/1/2017. I want to convert the dates to 2017-01. My code below gives and error:
Code:
data$NewDate <- format(as.Date(data$currentdate), "%Y-%m")
Error:
Error in charToDate(x) : character string is not in a standard unambiguous format
How do I fix that?