I have a data frame in R
where, the numeric data represents a series of time in 24 hour format. The catch here is the data is not entered correctly. The data is inconsistent in terms of the four digits to be entered.
A sample of the data can be found here:
As it is visible in the data here, 1) is in correct and desired format.
The second entry is meant to be 0100, but the zero at the start have been lost, or entered incorrectly.
Similarly, for the rest of the data 3) 9 in place of 0009 4) 110 in place of 0110 5) 10 in place of 0010 6) 0 in place of 0000 7) 209 in place of 0209 8) 330 in place of 0330
This is a part of a larger data frame with loads of data discrepancies, there are a total of 1652 data entries and all of them needs to be pre-processed before we start analysing in R
.
Is there any function/library/code available to get the required output.
Just for another sample, I'm attaching another picture which will help you to validate the code:
- 2330
- 0115
- 0034
- 0130
- 0020
- 0000
- 0257
- 0330
Cheers