I\'m working with the London crime dataset which contains dates in an integer format. I melted them and now they have become factors.
factor
For example, \"
\"
You can use parse_datetime from the readr package: testdate <- factor("X200801") parse_datetime(as.character(testdate), format = 'X%Y%M')
testdate <- factor("X200801")
parse_datetime(as.character(testdate), format = 'X%Y%M')
I wouldn't recommend using MM/DD/YYY in R. Keeping things in the ISO 8601 format is preferable.