So I have a vector of character strings (not formatted as time intentionally).
TIME
00:35 AM
08:34 AM
10:10 AM
10:00 PM
09:45 PM
02:00 PM
07:47 PM
12:22AM
I would like to make it so that the leading 0's are gone. If there are two leading 0's then it must be 12. Notice the extra space in the final entry, some data is formatted like that so the solution must take that into account.
Final outcome desired:
TIME
12:35 AM
8:34 AM
10:10 AM
10:00 PM
9:45 PM
2:00 PM
7:47 PM
12:22 AM
Tidyverse solution preferred but I attempted using str_remove
to no avail.