It would be nice if I could remove the alphabets from the numbers.
For example,
times <- c("01:10 22 Mar", "13:15", "04:25 10 Jun", "23:30", "10:25 13 Mar", "05:05 02 Mar", "10:25 13 Mar", "19:15", "23:00", "09:20 10 May", "19:50", "19:15 04 Mar", "13:15", "12:35 13 Jun", "19:15 13 Jun", "12:35 28 May")
The desired output should look like this:
times <- c("01:10", "13:15", "04:25", "23:30", "10:25", "05:05", "10:25", "19:15", "23:00", "09:20", "19:50", "19:15", "13:15", "12:35", "19:15", "12:35")
Here's what I tried:
times <- str_replace_all(times, "[^\\d]", "")
This is what I got:
times <- c("011022", "1315", "042510", "2330", "102513", "050502", "102513", "1915", "2300", "092010", "1950", "191504", "1315", "123513", "191513", "123528")
My searches for similar topics online turned up some, but in different programming languages or entirely new.