I am trying to separate a column with time increments that are in a character format.
The format is MM:SS for most observations, but there are a few with the HH:MM:SS format. I am trying to separate into columns based on the ":" so I can reduce the times to seconds to preform some basic analysis.
I would like to get this:
Time
1 11:15
2 12:36
3 1:15:17
into this:
Hour Minuet Second
1 NA 11 15
2 NA 12 36
3 1 15 17
I have tried
separate(df, time, into = c("Hours", "Minuets", "Seconds"), by = ":")
Which returns:
Hour Minuet Second
1 11 15 NA
2 12 36 NA
3 1 15 17