I’m very new to R and cleaning a dataset that has times inconsistently entered, like this: 450pm, 10:00am, 245pm, 9am, 12:30pm.
I would like to make sure everything appears consistent and is either 3 or 4 digits, like this:
4:50pm, 10:00am, 2:45pm, 9:00am, 12:30pm.
How can I go about with doing this?
I played around with gsub and paste functions to try to add ‘:00’ to numbers like ‘9am’, but no luck. Would appreciate any help.
gotmilk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.